====== PHP Hosted SecureCards ====== **Settings file (%gatewaySampleFileName_account.inc):** ---- \\ **SecureCard redirect (%gatewaySampleFileName_securecard.php):**
\n"; writeHiddenField("ACTION", $secureCardAction); writeHiddenField("TERMINALID", $terminalId); writeHiddenField("MERCHANTREF", $secureCardMerchantRef); writeHiddenField("DATETIME", $dateTime); writeHiddenField("HASH", $requestHash); # Write the JavaScript that will submit the form to Gateway. echo '
Submitting SecureCard request to Gateway...'; ?>
---- \\ Secure Token URL (**%gatewaySampleFileName_securecard_response.php**) (URL for this page is setup as “**Secure Token URL**” through Terminal Setup in the %SelfCare ): ---- \\ **Helper file (%gatewaySampleFileName_securecard_functions.inc):** "; } # This generates a DATETIME value in the correct format expected in the request. function requestDateTime() { return date('d-m-Y:H:i:s:000'); } # This is used to generate the Authorisation Request Hash. function secureCardRequestHash($secureCardMerchantRef, $dateTime, $secureCardAction) { global $terminalId, $secret; return md5($terminalId . $secureCardMerchantRef . $dateTime . $secureCardAction . $secret); } # This function is used to validate that the MPI Response Hash from the server is correct. # If secureCardResponseHashIsValid(...) != $_REQUEST["HASH"] then an error should be shown and the SecureCard registration should fail. function secureCardResponseHashIsValid($responseCode, $responseText, $secureCardMerchantRef, $secureCardCardRef, $dateTime, $responseHash) { global $terminalId, $secret; return (md5($terminalId . $responseCode . $responseText . $secureCardMerchantRef . $secureCardCardRef . $dateTime . $secret)==$responseHash); } ?>