From 7e4b55f6b5aae9d3ac66bc349b3fe8e9d7410bb0 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 15 Jun 2021 22:31:16 +0100 Subject: [PATCH 01/14] PSD2 patch --- src/Message/AbstractRequest.php | 41 ++++++++- src/Message/DirectAuthorizeRequest.php | 15 +++ .../DirectCompleteAuthorizeRequest.php | 26 ++++-- src/Message/Response.php | 20 +++- src/Traits/GatewayParamsTrait.php | 91 +++++++++++++++++++ 5 files changed, 178 insertions(+), 15 deletions(-) diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index 31f02334..a7c8106f 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -17,6 +17,34 @@ abstract class AbstractRequest extends OmnipayAbstractRequest implements Constan { use GatewayParamsTrait; + /** + * Flag whether customer's browser can run javascript. + */ + const BROWSER_JAVASCRIPT_YES = 1; + const BROWSER_JAVASCRIPT_NO = 0; + + /** + * Fallback browser language + */ + const BROWSER_LANGUAGE = 'en-GB'; + + /** + * Dimensions of the challenge window to be displayed to the cardholder. + * + * 01 = 250 x 400 + * 02 = 390 x 400 + * 03 = 500 x 600 + * 04 = 600 x 400 + * 05 = Full screen + * + * @var string + */ + const CHALLENGE_WINDOW_SIZE_01 = '01'; + const CHALLENGE_WINDOW_SIZE_02 = '02'; + const CHALLENGE_WINDOW_SIZE_03 = '03'; + const CHALLENGE_WINDOW_SIZE_04 = '04'; + const CHALLENGE_WINDOW_SIZE_05 = '05'; + /** * @var string The service name, used in the endpoint URL. */ @@ -70,6 +98,17 @@ public function getTxType() throw new InvalidRequestException('Transaction type not defined.'); } + + public function getProtocol() + { + return $this->getParameter('protocol'); + } + + public function setProtocol($value) + { + return $this->setParameter('protocol', $value); + } + /** * Basic authorisation, transaction type and protocol version. * @@ -79,7 +118,7 @@ protected function getBaseData() { $data = array(); - $data['VPSProtocol'] = $this->VPSProtocol; + $data['VPSProtocol'] = $this->getProtocol() ?: $this->VPSProtocol; $data['TxType'] = $this->getTxType(); $data['Vendor'] = $this->getVendor(); $data['AccountType'] = $this->getAccountType() ?: static::ACCOUNT_TYPE_E; diff --git a/src/Message/DirectAuthorizeRequest.php b/src/Message/DirectAuthorizeRequest.php index 19325f24..fede111a 100644 --- a/src/Message/DirectAuthorizeRequest.php +++ b/src/Message/DirectAuthorizeRequest.php @@ -56,6 +56,21 @@ protected function getBaseAuthorizeData() $data['VendorTxCode'] = $this->getTransactionId(); $data['ClientIPAddress'] = $this->getClientIp(); + $data['BrowserJavascriptEnabled'] = $this->getBrowserJavascriptEnabled() ?: static::BROWSER_JAVASCRIPT_NO; + $data['BrowserLanguage'] = $this->getBrowserLanguage() ?: static::BROWSER_LANGUAGE; + $data['ThreeDSNotificationURL'] = $this->getThreeDSNotificationURL(); + $data['BrowserAcceptHeader'] = $_SERVER['HTTP_ACCEPT']; + $data['BrowserUserAgent'] = $_SERVER['HTTP_USER_AGENT']; + $data['ChallengeWindowSize'] = $this->getChallengeWindowSize() ?: static::CHALLENGE_WINDOW_SIZE_05; + // ---- + // ---- "4.00" - required if BrowserJavascriptEnabled == "1" + $data['BrowserJavaEnabled'] = $this->getBrowserJavaEnabled(); + $data['BrowserColorDepth'] = $this->getBrowserColorDepth(); + $data['BrowserScreenHeight'] = $this->getBrowserScreenHeight(); + $data['BrowserScreenWidth'] = $this->getBrowserScreenWidth(); + $data['BrowserTZ'] = $this->getBrowserTZ(); + // ---- + $data['ApplyAVSCV2'] = $this->getApplyAVSCV2() ?: static::APPLY_AVSCV2_DEFAULT; $data['Apply3DSecure'] = $this->getApply3DSecure() ?: static::APPLY_3DSECURE_APPLY; diff --git a/src/Message/DirectCompleteAuthorizeRequest.php b/src/Message/DirectCompleteAuthorizeRequest.php index 973ae88e..863475ca 100644 --- a/src/Message/DirectCompleteAuthorizeRequest.php +++ b/src/Message/DirectCompleteAuthorizeRequest.php @@ -16,19 +16,27 @@ public function getService() public function getData() { - // Inconsistent letter case is intentional. - // The issuing bank will return PaRes, but the merchant - // site must send this result as PARes to Sage Pay. + if($this->httpRequest->request->has('cres')){ + $data = array( + 'CRes' => $this->httpRequest->request->get('cres'), // inconsistent caps are intentional + 'VPSTxId' => $this->httpRequest->request->get('threeDSSessionData'), + ); - $data = array( - 'MD' => $this->getMd() ?: $this->httpRequest->request->get('MD'), - 'PARes' => $this->getPaRes() ?: $this->httpRequest->request->get('PaRes'), - ); + if (empty($data['CRes']) || empty($data['VPSTxId'])) { + throw new InvalidResponseException; + } + }else{ + $data = array( + 'MD' => $this->httpRequest->request->get('MD'), + 'PARes' => $this->httpRequest->request->get('PaRes'), // inconsistent caps are intentional + ); - if (empty($data['MD']) || empty($data['PARes'])) { - throw new InvalidResponseException; + if (empty($data['MD']) || empty($data['PARes'])) { + throw new InvalidResponseException; + } } + return $data; } diff --git a/src/Message/Response.php b/src/Message/Response.php index 34d54d34..76fefb25 100644 --- a/src/Message/Response.php +++ b/src/Message/Response.php @@ -96,11 +96,21 @@ public function getRedirectMethod() public function getRedirectData() { if ($this->isRedirect()) { - return array( - 'PaReq' => $this->getDataItem('PAReq'), - 'TermUrl' => $this->getRequest()->getReturnUrl(), - 'MD' => $this->getDataItem('MD'), - ); + if (isset($this->data['CReq'])) { + // 3DSv2 + return [ + 'creq' => $this->data['CReq'], + 'threeDSSessionData' => $this->data['VPSTxId'], + ]; + } else { + // fallback from 3DSv2 to 3DSv1 + return [ + 'PaReq' => $this->data['PAReq'], + 'TermUrl' => $this->getRequest()->getReturnUrl(), + 'MD' => $this->data['MD'], + ]; + } + } } diff --git a/src/Traits/GatewayParamsTrait.php b/src/Traits/GatewayParamsTrait.php index 83ccdd26..df1e5b3d 100644 --- a/src/Traits/GatewayParamsTrait.php +++ b/src/Traits/GatewayParamsTrait.php @@ -257,4 +257,95 @@ public function setDisableUtf8Decode($value) { return $this->setParameter('disableUtf8Decode', $value); } + + public function setThreeDSNotificationURL($value) + { + return $this->setParameter('ThreeDSNotificationURL', $value); + } + + public function getThreeDSNotificationURL() + { + return $this->getParameter('ThreeDSNotificationURL'); + } + + public function setBrowserJavascriptEnabled($value) + { + return $this->setParameter('BrowserJavascriptEnabled', $value); + } + + public function getBrowserJavascriptEnabled() + { + return $this->getParameter('BrowserJavascriptEnabled'); + } + + public function setBrowserLanguage($value) + { + return $this->setParameter('BrowserLanguage', $value); + } + + public function getBrowserLanguage() + { + return $this->getParameter('BrowserLanguage'); + } + + public function setChallengeWindowSize($value) + { + return $this->setParameter('ChallengeWindowSize', $value); + } + + public function getChallengeWindowSize() + { + return $this->getParameter('ChallengeWindowSize'); + } + + public function setBrowserJavaEnabled($value) + { + return $this->setParameter('BrowserJavaEnabled', $value); + } + + public function getBrowserJavaEnabled() + { + return $this->getParameter('BrowserJavaEnabled'); + } + + + public function setBrowserColorDepth($value) + { + return $this->setParameter('BrowserColorDepth', $value); + } + + public function getBrowserColorDepth() + { + return $this->getParameter('BrowserColorDepth'); + } + + public function setBrowserScreenHeight($value) + { + return $this->setParameter('BrowserScreenHeight', $value); + } + + public function getBrowserScreenHeight() + { + return $this->getParameter('BrowserScreenHeight'); + } + + public function setBrowserScreenWidth($value) + { + return $this->setParameter('BrowserScreenWidth', $value); + } + + public function getBrowserScreenWidth() + { + return $this->getParameter('BrowserScreenWidth'); + } + + public function setBrowserTZ($value) + { + return $this->setParameter('BrowserTZ', $value); + } + + public function getBrowserTZ() + { + return $this->getParameter('BrowserTZ'); + } } From b9d8557157829e70adf90dc3c45b7b3d1eee6b22 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 15 Jun 2021 22:34:02 +0100 Subject: [PATCH 02/14] use on default v4 --- src/Message/AbstractRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index a7c8106f..8875edc4 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -53,7 +53,7 @@ abstract class AbstractRequest extends OmnipayAbstractRequest implements Constan /** * @var string The protocol version number. */ - protected $VPSProtocol = '3.00'; + protected $VPSProtocol = '4.00'; /** * @var string Endpoint base URLs. From 44da7edbcbfe6abb226e3bcde8b2c2790cb9974a Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 15 Jun 2021 23:24:15 +0100 Subject: [PATCH 03/14] use detault v4 - option to select --- src/Message/AbstractRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index 8875edc4..a7c8106f 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -53,7 +53,7 @@ abstract class AbstractRequest extends OmnipayAbstractRequest implements Constan /** * @var string The protocol version number. */ - protected $VPSProtocol = '4.00'; + protected $VPSProtocol = '3.00'; /** * @var string Endpoint base URLs. From 7d0c45a24d7253ae4442ceb592a18dec63087f26 Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 16 Jun 2021 13:41:53 +0100 Subject: [PATCH 04/14] add additional fields for 3dsecure repeated payments --- src/Message/DirectAuthorizeRequest.php | 11 ++++ src/Traits/GatewayParamsTrait.php | 80 ++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/src/Message/DirectAuthorizeRequest.php b/src/Message/DirectAuthorizeRequest.php index fede111a..4e6179ed 100644 --- a/src/Message/DirectAuthorizeRequest.php +++ b/src/Message/DirectAuthorizeRequest.php @@ -71,6 +71,17 @@ protected function getBaseAuthorizeData() $data['BrowserTZ'] = $this->getBrowserTZ(); // ---- + // repeat payments required fields + $data['MITType'] = $this->getMITType(); + $data['COFUsage'] = $this->getCOFUsage(); + $data['InitiatedType'] = $this->getInitiatedType(); + $data['SchemeTraceID'] = $this->getSchemeTraceID(); + $data['RecurringExpiry'] = $this->getRecurringExpiry(); + $data['RecurringFrequency'] = $this->getRecurringFrequency(); + $data['ACSTransID'] = $this->getACSTransID(); + $data['DSTransID'] = $this->getDSTransID(); + + $data['ApplyAVSCV2'] = $this->getApplyAVSCV2() ?: static::APPLY_AVSCV2_DEFAULT; $data['Apply3DSecure'] = $this->getApply3DSecure() ?: static::APPLY_3DSECURE_APPLY; diff --git a/src/Traits/GatewayParamsTrait.php b/src/Traits/GatewayParamsTrait.php index df1e5b3d..15e56c14 100644 --- a/src/Traits/GatewayParamsTrait.php +++ b/src/Traits/GatewayParamsTrait.php @@ -348,4 +348,84 @@ public function getBrowserTZ() { return $this->getParameter('BrowserTZ'); } + + public function setInitiatedType($value) + { + return $this->setParameter('InitiatedType', $value); + } + + public function getInitiatedType() + { + return $this->getParameter('InitiatedType'); + } + + public function setCOFUsage($value) + { + return $this->setParameter('COFUsage', $value); + } + + public function getCOFUsage() + { + return $this->getParameter('COFUsage'); + } + + public function setMITType($value) + { + return $this->setParameter('MITType', $value); + } + + public function getMITType() + { + return $this->getParameter('MITType'); + } + + public function setSchemeTraceID($value) + { + return $this->setParameter('SchemeTraceID', $value); + } + + public function getSchemeTraceID() + { + return $this->getParameter('SchemeTraceID'); + } + + public function setRecurringExpiry($value) + { + return $this->setParameter('RecurringExpiry', $value); + } + + public function getRecurringExpiry() + { + return $this->getParameter('RecurringExpiry'); + } + + public function setRecurringFrequency($value) + { + return $this->setParameter('RecurringFrequency', $value); + } + + public function getRecurringFrequency() + { + return $this->getParameter('RecurringFrequency'); + } + + public function setACSTransID($value) + { + return $this->setParameter('ACSTransID', $value); + } + + public function getACSTransID() + { + return $this->getParameter('ACSTransID'); + } + + public function setDSTransID($value) + { + return $this->setParameter('DSTransID', $value); + } + + public function getDSTransID() + { + return $this->getParameter('DSTransID'); + } } From 8cd7bd6a0368725759e3aa1f42498422c92752fb Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 17 Jun 2021 18:19:18 +0100 Subject: [PATCH 05/14] config VPSsignature for server integration in v4 --- src/Traits/ServerNotifyTrait.php | 76 +++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/src/Traits/ServerNotifyTrait.php b/src/Traits/ServerNotifyTrait.php index 0d54111b..f5c3de3f 100644 --- a/src/Traits/ServerNotifyTrait.php +++ b/src/Traits/ServerNotifyTrait.php @@ -69,28 +69,60 @@ public function buildSignature() // Do not use any of these fields for a successful TOKEN transaction, // even though some of them may be present. - $signatureData = array_merge( - $signatureData, - array( - // Details for AVSCV2: - $this->getAddressResult(), - $this->getPostCodeResult(), - $this->getCV2Result(), - // - $this->getGiftAid(), - $this->get3DSecureStatus(), - $this->getCAVV(), - $this->getAddressStatus(), - $this->getPayerStatus(), - $this->getCardType(), - $this->getLast4Digits(), - // New for protocol v3.00 - $this->getDeclineCode(), - $this->getExpiryDate(), - $this->getFraudResponse(), - $this->getBankAuthCode(), - ) - ); + // if protocol 3 + if($this->getProtocol() == '3.00'){ + $signatureData = array_merge( + $signatureData, + array( + // Details for AVSCV2: + $this->getAddressResult(), + $this->getPostCodeResult(), + $this->getCV2Result(), + // + $this->getGiftAid(), + $this->get3DSecureStatus(), + $this->getCAVV(), + $this->getAddressStatus(), + $this->getPayerStatus(), + $this->getCardType(), + $this->getLast4Digits(), + // New for protocol v3.00 + $this->getDeclineCode(), + $this->getExpiryDate(), + $this->getFraudResponse(), + $this->getBankAuthCode(), + ) + ); + } elseif ($this->getProtocol() =='4.00'){ + $signatureData = array_merge( + $signatureData, + array( + // Details for AVSCV2: + $this->getAddressResult(), + $this->getPostCodeResult(), + $this->getCV2Result(), + // + $this->getGiftAid(), + $this->get3DSecureStatus(), + $this->getCAVV(), + $this->getAddressStatus(), + $this->getPayerStatus(), + $this->getCardType(), + $this->getLast4Digits(), + // New for protocol v3.00 + $this->getDeclineCode(), + $this->getExpiryDate(), + $this->getFraudResponse(), + $this->getBankAuthCode(), + $this->getACSTransID(), + $this->getDSTransID(), + $this->getSchemeTraceID(), + ) + ); + } else { + die('unsupported version used'); + } + } return md5(implode('', $signatureData)); From a66e3eb7ea4216b2d4ae5555baa6f97fedb77a18 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 17 Jun 2021 18:39:37 +0100 Subject: [PATCH 06/14] config VPSsignature for server integration in v4 --- src/Traits/ServerNotifyTrait.php | 74 ++++++++++++-------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/src/Traits/ServerNotifyTrait.php b/src/Traits/ServerNotifyTrait.php index f5c3de3f..defc2203 100644 --- a/src/Traits/ServerNotifyTrait.php +++ b/src/Traits/ServerNotifyTrait.php @@ -69,58 +69,38 @@ public function buildSignature() // Do not use any of these fields for a successful TOKEN transaction, // even though some of them may be present. - // if protocol 3 - if($this->getProtocol() == '3.00'){ + $signatureData = array_merge( + $signatureData, + array( + // Details for AVSCV2: + $this->getAddressResult(), + $this->getPostCodeResult(), + $this->getCV2Result(), + // + $this->getGiftAid(), + $this->get3DSecureStatus(), + $this->getCAVV(), + $this->getAddressStatus(), + $this->getPayerStatus(), + $this->getCardType(), + $this->getLast4Digits(), + // New for protocol v3.00 + $this->getDeclineCode(), + $this->getExpiryDate(), + $this->getFraudResponse(), + $this->getBankAuthCode(), + ) + ); + // new in v4 + if ( $this->getDataItem('VPSProtocol') =='4.00'){ $signatureData = array_merge( $signatureData, array( - // Details for AVSCV2: - $this->getAddressResult(), - $this->getPostCodeResult(), - $this->getCV2Result(), - // - $this->getGiftAid(), - $this->get3DSecureStatus(), - $this->getCAVV(), - $this->getAddressStatus(), - $this->getPayerStatus(), - $this->getCardType(), - $this->getLast4Digits(), - // New for protocol v3.00 - $this->getDeclineCode(), - $this->getExpiryDate(), - $this->getFraudResponse(), - $this->getBankAuthCode(), + $this->getDataItem('ACSTransID'), + $this->getDataItem('DSTransID'), + $this->getDataItem('SchemeTraceID'), ) ); - } elseif ($this->getProtocol() =='4.00'){ - $signatureData = array_merge( - $signatureData, - array( - // Details for AVSCV2: - $this->getAddressResult(), - $this->getPostCodeResult(), - $this->getCV2Result(), - // - $this->getGiftAid(), - $this->get3DSecureStatus(), - $this->getCAVV(), - $this->getAddressStatus(), - $this->getPayerStatus(), - $this->getCardType(), - $this->getLast4Digits(), - // New for protocol v3.00 - $this->getDeclineCode(), - $this->getExpiryDate(), - $this->getFraudResponse(), - $this->getBankAuthCode(), - $this->getACSTransID(), - $this->getDSTransID(), - $this->getSchemeTraceID(), - ) - ); - } else { - die('unsupported version used'); } } From 450d82a74561745bb1b1568aee055d60691857b5 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 21 Jun 2021 18:44:11 +0100 Subject: [PATCH 07/14] allow php8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 40ebdeb5..39d949bd 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ } }, "require": { - "php": "^5.6|^7", + "php": "^5.6|^7|^8", "omnipay/common": "~3.0" }, "require-dev": { From e10207dc069628e2a57d3abf52b93af567b05ffe Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 21 Jun 2021 18:49:11 +0100 Subject: [PATCH 08/14] rename package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 39d949bd..d0c11144 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "omnipay/sagepay", + "name": "saintanger/sagepay", "type": "library", "description": "Sage Pay driver for the Omnipay PHP payment processing library", "keywords": [ From 42b08f59328ce3aad0da2771ea22b59620e733c5 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 21 Jun 2021 18:50:44 +0100 Subject: [PATCH 09/14] rename package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0c11144..d55d3ce1 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "saintanger/sagepay", + "name": "saintanger/omnipay-sagepay", "type": "library", "description": "Sage Pay driver for the Omnipay PHP payment processing library", "keywords": [ From 9ce22acdbb814fa091797b8fe368f0b0f3fa13de Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 21 Jun 2021 18:54:02 +0100 Subject: [PATCH 10/14] rename package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d55d3ce1..39d949bd 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "saintanger/omnipay-sagepay", + "name": "omnipay/sagepay", "type": "library", "description": "Sage Pay driver for the Omnipay PHP payment processing library", "keywords": [ From 61003e9869eb25d4c6cf1ae48f6ca9bb63278afb Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 22 Jun 2021 11:05:51 +0100 Subject: [PATCH 11/14] rename package --- composer.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 39d949bd..a4a28ded 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "omnipay/sagepay", + "name": "saintanger/omnipay-sagepay", "type": "library", "description": "Sage Pay driver for the Omnipay PHP payment processing library", "keywords": [ @@ -12,6 +12,11 @@ "sage pay", "sagepay" ], + "version": "master", + "source": { + "url": "git@github.com:saintanger/omnipay-sagepay.git", + "type": "git" + }, "homepage": "https://github.com/thephpleague/omnipay-sagepay", "license": "MIT", "authors": [ From 9531c532aa1600a6cfc6dbac70d94a4f2816e9c7 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 22 Jun 2021 11:06:26 +0100 Subject: [PATCH 12/14] rename package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a4a28ded..8ea1ad83 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "version": "master", "source": { - "url": "git@github.com:saintanger/omnipay-sagepay.git", + "url": "https://github.com:saintanger/omnipay-sagepay.git", "type": "git" }, "homepage": "https://github.com/thephpleague/omnipay-sagepay", From 2590b9a41dc62bf82850182603abece48b22ed89 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 22 Jun 2021 11:09:37 +0100 Subject: [PATCH 13/14] rename package --- composer.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 8ea1ad83..f71e437f 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "saintanger/omnipay-sagepay", + "name": "omnipay/sagepay", "type": "library", "description": "Sage Pay driver for the Omnipay PHP payment processing library", "keywords": [ @@ -12,11 +12,7 @@ "sage pay", "sagepay" ], - "version": "master", - "source": { - "url": "https://github.com:saintanger/omnipay-sagepay.git", - "type": "git" - }, + "homepage": "https://github.com/thephpleague/omnipay-sagepay", "license": "MIT", "authors": [ From bb0d218c8cd66b45480fcb683ce05dabbc3428ae Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 30 Jun 2021 09:07:25 +0100 Subject: [PATCH 14/14] add additional fields for v4 requests on repeat shared protocol --- src/Message/SharedRepeatAuthorizeRequest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Message/SharedRepeatAuthorizeRequest.php b/src/Message/SharedRepeatAuthorizeRequest.php index 23331684..a65a72be 100644 --- a/src/Message/SharedRepeatAuthorizeRequest.php +++ b/src/Message/SharedRepeatAuthorizeRequest.php @@ -91,6 +91,19 @@ public function getData() $data['BasketXML'] = $basketXML; } + // add v4 request fields + if ($this->getProtocol() == '4.00'){ + + $data['MITType'] = $this->getMITType(); + $data['COFUsage'] = $this->getCOFUsage(); + $data['InitiatedType'] = $this->getInitiatedType(); + $data['SchemeTraceID'] = $this->getSchemeTraceID(); + $data['RecurringExpiry'] = $this->getRecurringExpiry(); + $data['RecurringFrequency'] = $this->getRecurringFrequency(); + $data['ACSTransID'] = $this->getACSTransID(); + $data['DSTransID'] = $this->getDSTransID(); + } + return $data; }