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