SetDontCheckSecurity($dontCheckSecurity); if($cvv != "") $securereg->SetCvv($cvv); if($issueNo != "") $securereg->SetIssueNo($issueNo); $response = $securereg->ProcessRequestToGateway($secret,$testAccount,$gateway); unset($secureCardCardRef); if($response->IsError()){ echo 'AN ERROR OCCURED, Card details not registered. Error details: ' . $response->ErrorString(); } else { $merchantRef = $response->MerchantReference(); $expectedResponseHash = md5($terminalId.$response->MerchantReference().$response->CardReference().$response->DateTime().$secret); if($expectedResponseHash != $response->Hash()) { echo 'SECURECARD REGISTRATION FAILED: INVALID RESPONSE HASH. Please contact ' . $adminEmail . ' or call ' . $adminPhone . ' to clarify if your card details were stored.'; if(isset($merchantRef)) { echo 'Please quote Nuvei Terminal ID: ' . $terminalId . ', and SecureCard Merchant Reference: ' . $response->MerchantReference() . ' when mailling or calling.'; } } else { echo "SecureCard successfully stored."; } } ?>