Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GatewayChecksum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"; //

//////////////////////////////////////////////////////////////////////
//
Expand All @@ -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";
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/GatewayResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }
Expand Down
20 changes: 19 additions & 1 deletion src/GatewayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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';
}

//
Expand All @@ -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;
}

Expand Down
9 changes: 9 additions & 0 deletions src/TestAuthOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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: " .
Expand Down