diff --git a/src/GatewayChecksum.php b/src/GatewayChecksum.php index d66a862..f7e25ec 100644 --- a/src/GatewayChecksum.php +++ b/src/GatewayChecksum.php @@ -8,8 +8,8 @@ // class GatewayChecksum { public static $checksum = ""; - public static $baseChecksum = "c6b73c8b32c1df76dde8aa4e73ddadc4"; - public static $versionNo = "P6.17"; // + public static $baseChecksum = "5096ece7e2320e91d897f71e92701a93"; + public static $versionNo = "P6.18"; // ////////////////////////////////////////////////////////////////////// // @@ -27,7 +27,7 @@ static function SetVersion() md5_file($dirName . "/GatewayCodes.php"); GatewayChecksum::$checksum = md5($baseString); if (GatewayChecksum::$checksum != GatewayChecksum::$baseChecksum) - GatewayChecksum::$versionNo = "P6.17m"; + GatewayChecksum::$versionNo = "P6.18m"; } } diff --git a/src/GatewayResponse.php b/src/GatewayResponse.php index 8839606..03be182 100644 --- a/src/GatewayResponse.php +++ b/src/GatewayResponse.php @@ -170,6 +170,9 @@ static function MERCHANT_PRODUCT_ID() { return "merchantProductID"; } static function MERCHANT_SITE_ID() { return "merchantSiteID"; } static function PAREQ() { return "PAREQ"; } static function REASON_CODE() { return "reasonCode"; } + static function REASON_CODE_NAME() { return "reasonCodeName"; } + static function MERCHANT_REASON_CODE_DESCRIPTION() { return "merchantReasonCodeDescription"; } + static function CARDHOLDER_REASON_CODE_DESCRIPTION() { return "cardholderReasonCodeDescription"; } static function REBILL_AMOUNT() { return "rebillAmount"; } static function REBILL_DATE() { return "rebillDate"; } static function REBILL_END_DATE() { return "rebillEndDate"; } diff --git a/src/GatewayService.php b/src/GatewayService.php index 22d72a2..c7d3e22 100644 --- a/src/GatewayService.php +++ b/src/GatewayService.php @@ -703,6 +703,9 @@ function PerformCURLTransaction($host, $request, $response) $response->Set(GatewayResponse::EXCEPTION(), "curl_init() error"); $response->SetResults(GatewayCodes__RESPONSE_REQUEST_ERROR, GatewayCodes__REASON_INVALID_URL); + $response->Set(GatewayResponse::REASON_CODE_NAME(), 'REASON_INVALID_URL'); + $response->Set(GatewayResponse::MERCHANT_REASON_CODE_DESCRIPTION(), 'Invalid URL'); + $response->Set(GatewayResponse::CARDHOLDER_REASON_CODE_DESCRIPTION(), 'Invalid URL'); return GatewayCodes__RESPONSE_REQUEST_ERROR; } @@ -790,17 +793,29 @@ function PerformCURLTransaction($host, $request, $response) case CURLE_SSL_CONNECT_ERROR: // Connection failures case CURLE_COULDNT_CONNECT: $internalCode = GatewayCodes__REASON_UNABLE_TO_CONNECT; + $internalCodeName = 'REASON_UNABLE_TO_CONNECT'; + $internalMerchantCodeDescription = 'Unable to Connect'; + $internalCardholderCodeDescription = 'Unable to Connect'; break; // Done with request case CURLE_SEND_ERROR: // Failed sending data $internalCode = GatewayCodes__REASON_REQUEST_XMIT_ERROR; + $internalCodeName = 'REASON_REQUEST_XMIT_ERROR'; + $internalMerchantCodeDescription = 'Transmit Error'; + $internalCardholderCodeDescription = 'Transmit Error'; break; // Done with request case CURLE_OPERATION_TIMEOUTED: // Time-out reached $internalCode = GatewayCodes__REASON_RESPONSE_READ_TIMEOUT; + $internalCodeName = 'REASON_RESPONSE_READ_TIMEOUT'; + $internalMerchantCodeDescription = 'Read Timeout'; + $internalCardholderCodeDescription = 'Read Timeout'; break; // Done with request case CURLE_RECV_ERROR: // Failed reading data case CURLE_READ_ERROR: default: - $internalCode = GatewayCodes__REASON_RESPONSE_READ_ERROR; + $internalCode = GatewayCodes__REASON_RESPONSE_READ_ERROR; + $internalCodeName = 'REASON_RESPONSE_READ_ERROR'; + $internalMerchantCodeDescription = 'Read Error'; + $internalCardholderCodeDescription = 'Read Error'; } // @@ -810,6 +825,9 @@ function PerformCURLTransaction($host, $request, $response) $response->Set(GatewayResponse::EXCEPTION(), $errorString); $response->SetResults(GatewayCodes__RESPONSE_SYSTEM_ERROR, $internalCode); + $response->Set(GatewayResponse::REASON_CODE_NAME(), $internalCodeName); + $response->Set(GatewayResponse::MERCHANT_REASON_CODE_DESCRIPTION(), $internalMerchantCodeDescription); + $response->Set(GatewayResponse::CARDHOLDER_REASON_CODE_DESCRIPTION(), $internalCardholderCodeDescription); return GatewayCodes__RESPONSE_SYSTEM_ERROR; } diff --git a/src/TestAuthOnly.php b/src/TestAuthOnly.php index 7454020..95591c7 100644 --- a/src/TestAuthOnly.php +++ b/src/TestAuthOnly.php @@ -80,6 +80,9 @@ print "Auth-Only succeeded\n"; print "Response Code: " . $response->Get(GatewayResponse::RESPONSE_CODE()) . "\n"; print "Reason Code: " . $response->Get(GatewayResponse::REASON_CODE()) . "\n"; + print "Reason Code Name: " . $response->Get(GatewayResponse::REASON_CODE_NAME()) . "\n"; + print "Merchant Reason Code Description: " . $response->Get(GatewayResponse::MERCHANT_REASON_CODE_DESCRIPTION()) . "\n"; + print "Cardholder Reason Code Description: " . $response->Get(GatewayResponse::CARDHOLDER_REASON_CODE_DESCRIPTION()) . "\n"; print "Auth No: " . $response->Get(GatewayResponse::AUTH_NO()) . "\n"; print "AVS: " . $response->Get(GatewayResponse::AVS_RESPONSE()) . "\n"; print "CVV2: " . $response->Get(GatewayResponse::CVV2_CODE()) . "\n"; @@ -97,6 +100,12 @@ $response->Get(GatewayResponse::RESPONSE_CODE()) . "\n"; print "Reason Code: " . $response->Get(GatewayResponse::REASON_CODE()) . "\n"; + print "Reason Code Name: " . + $response->Get(GatewayResponse::REASON_CODE_NAME()) . "\n"; + print "Merchant Reason Code Description: " . + $response->Get(GatewayResponse::MERCHANT_REASON_CODE_DESCRIPTION()) . "\n"; + print "Cardholder Reason Code Description: " . + $response->Get(GatewayResponse::CARDHOLDER_REASON_CODE_DESCRIPTION()) . "\n"; print "Exception: " . $response->Get(GatewayResponse::EXCEPTION()) . "\n"; print "Scrub: " .