====== PHP Hosted SecureCards ====== **Settings file (worldnet_account.inc):** ---- \\ **SecureCard redirect (worldnet_securetokens.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 Tokens URL (**worldnet_securetokens_response.php**) (URL for this page is setup as “**Secure Tokens URL**” through Terminal Setup in the Selfcare ): ---- \\ **Helper file (worldnet_securetokens_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); } ?>