示例#1
0
 public function PerformConfirmation($request, $response)
 {
     //
     //	Verify that we have a transaction ID for the confirmation
     //	message.
     //
     $confirmGUID = $response->Get(GatewayResponse::TRANSACT_ID());
     if ($confirmGUID == NULL) {
         // Don't have reference?
         $response->Set(GatewayResponse::EXCEPTION(), "BUG-CHECK - Missing confirmation GUID");
         $response->SetResults(GatewayCodes__RESPONSE_SYSTEM_ERROR, GatewayCodes__REASON_BUGCHECK);
         return FALSE;
         // Transaction failed
     }
     //
     //	Add the GUID to the request and send it back to the
     //	original server for confirmation.
     //
     $confirmResponse = new GatewayResponse();
     // Need a new response object
     $request->Set(GatewayRequest::TRANSACTION_TYPE(), "CC_CONFIRM");
     $request->Set(GatewayRequest::REFERENCE_GUID(), $confirmGUID);
     if ($this->PerformTargetedTransaction($request, $confirmResponse)) {
         return TRUE;
     }
     //////////////////////////////////////////////////////////////////////
     //
     //	12-21-2011	darcy
     //
     //	If we experienced a system error, retry the confirmation.
     //
     if ($confirmResponse->Get(GatewayResponse::RESPONSE_CODE()) == GatewayCodes__RESPONSE_SYSTEM_ERROR) {
         sleep(2);
         // Short delay
         if ($this->PerformTargetedTransaction($request, $confirmResponse)) {
             return TRUE;
         }
     }
     //
     //////////////////////////////////////////////////////////////////////
     //
     //	If the confirmation failed, copy the reason and response code
     //	into the original response object to override the success.
     //
     $response->SetResults($confirmResponse->Get(GatewayResponse::RESPONSE_CODE()), $confirmResponse->Get(GatewayResponse::REASON_CODE()));
     $response->Set(GatewayResponse::EXCEPTION(), $confirmResponse->Get(GatewayResponse::EXCEPTION()));
     return FALSE;
     // And quit
 }
示例#2
0
 public static function TRANSACT_ID()
 {
     return GatewayRequest::REFERENCE_GUID();
 }