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
15 changes: 15 additions & 0 deletions src/GatewayRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,21 @@ static function APPLE_PAY_TOKEN()
return "APPLEPAYTOKEN";
}

static function PAY_TYPE()
{
return "payType";
}

static function PAY_VALIDITY()
{
return "payValidity";
}

static function PAY_DESCRIPTION()
{
return "payDescription";
}

static function PAY_TOKEN()
{
return "payToken";
Expand Down
20 changes: 20 additions & 0 deletions src/GatewayResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,26 @@ static function MERCHANT_ADVICE_CODE()
return "merchantAdviceCode";
}

static function PAY_TYPE()
{
return "payType";
}

static function PAY_STATUS()
{
return "payStatus";
}

static function PAY_CODE()
{
return "payCode";
}

static function PAY_QR_CODE()
{
return "payQrCode";
}

static function PAYMENT_LINK_URL()
{
return "PAYMENT_LINK_URL";
Expand Down
32 changes: 31 additions & 1 deletion src/GatewayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,25 @@ function PerformPurchase(GatewayRequest $request, GatewayResponse $response)
return $this->PerformConfirmation($request, $response);
}

//////////////////////////////////////////////////////////////////////
// PerformPayInit() - Perform an asynchronous payment initiation
// where the final response comes later.
//////////////////////////////////////////////////////////////////////
//
function PerformPayInit(GatewayRequest $request, GatewayResponse $response)
{
$request->Set(GatewayRequest::TRANSACTION_TYPE(), "PAY_INIT");
if ($request->Get(GatewayRequest::REFERENCE_GUID()) != null) {
if (!($this->PerformTargetedTransaction($request, $response))) {
return false;
}
} else {
if (!($this->PerformTransaction($request, $response))) {
return false;
}
}
return $this->PerformConfirmation($request, $response);
}

//////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -482,6 +501,11 @@ function PerformTransaction(GatewayRequest $request, GatewayResponse $response)
$request->Set("gatewayServlet", $urlBits['path'] . "?" . $urlBits['query']);
}

// echo "\ngatewayServer=" . $request->Get("gatewayServer");
// echo "\ngatewayProtocol=" . $request->Get("gatewayProtocol");
// echo "\ngatewayPortNo=" . $request->Get("gatewayPortNo");
// echo "\ngatewayServlet=" . $request->Get("gatewayServlet");

//
// If the request specifies a server name, use it.
// Otherwise, use the default for the service.
Expand Down Expand Up @@ -775,6 +799,12 @@ function PerformCURLTransaction($host, GatewayRequest $request, GatewayResponse
$urlPortNo = $this->rocketGatePortNo;
}

if (substr($urlServlet, 0, 1) == "/") {

$urlServlet = substr($urlServlet, 1);

}

//
// Build the URL for the gateway service.
//
Expand Down Expand Up @@ -831,7 +861,7 @@ function PerformCURLTransaction($host, GatewayRequest $request, GatewayResponse
// curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, FALSE);
//
//////////////////////////////////////////////////////////////////////

// echo "URL=" . $url;
//
// Setup the call to the URL.
//
Expand Down