From e144591fb50383a6540f9ee0dc2bffb0858c5869 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Mon, 28 Oct 2024 11:37:28 +0700 Subject: [PATCH 1/4] Update DirectPostAbstractRequest.php --- src/Message/DirectPostAbstractRequest.php | 42 ++++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Message/DirectPostAbstractRequest.php b/src/Message/DirectPostAbstractRequest.php index 465a62b..178f6a8 100644 --- a/src/Message/DirectPostAbstractRequest.php +++ b/src/Message/DirectPostAbstractRequest.php @@ -70,27 +70,29 @@ public function getBaseData() } $card = $this->getCard(); - - if ($billingPostcode = $card->getBillingPostcode()) { - $data['EPS_ZIPCODE'] = $billingPostcode; - } - - if ($billingCity = $card->getBillingCity()) { - $data['EPS_TOWN'] = $billingCity; - } - - if ($billingCountry = $card->getBillingCountry()) { - $data['EPS_BILLINGCOUNTRY'] = $billingCountry; + + if($card){ //UnionPay doesn't have card option + if ($billingPostcode = $card->getBillingPostcode()) { + $data['EPS_ZIPCODE'] = $billingPostcode; + } + + if ($billingCity = $card->getBillingCity()) { + $data['EPS_TOWN'] = $billingCity; + } + + if ($billingCountry = $card->getBillingCountry()) { + $data['EPS_BILLINGCOUNTRY'] = $billingCountry; + } + + if ($shippingCountry = $card->getShippingCountry()) { + $data['EPS_DELIVERYCOUNTRY'] = $shippingCountry; + } + + if ($emailAddress = $card->getEmail()) { + $data['EPS_EMAILADDRESS'] = $emailAddress; + } } - - if ($shippingCountry = $card->getShippingCountry()) { - $data['EPS_DELIVERYCOUNTRY'] = $shippingCountry; - } - - if ($emailAddress = $card->getEmail()) { - $data['EPS_EMAILADDRESS'] = $emailAddress; - } - + if ($this->getHasEMV3DSEnabled()) { $data['EPS_ORDERID'] = $this->getTransactionReference(); From fc6ab3b45447267bab788c45d9315dc119640751 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Mon, 28 Oct 2024 11:42:14 +0700 Subject: [PATCH 2/4] Fix style guide --- src/Message/DirectPostAbstractRequest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Message/DirectPostAbstractRequest.php b/src/Message/DirectPostAbstractRequest.php index 178f6a8..d8a8da2 100644 --- a/src/Message/DirectPostAbstractRequest.php +++ b/src/Message/DirectPostAbstractRequest.php @@ -70,8 +70,8 @@ public function getBaseData() } $card = $this->getCard(); - - if($card){ //UnionPay doesn't have card option + + if ($card){ //UnionPay doesn't have card option if ($billingPostcode = $card->getBillingPostcode()) { $data['EPS_ZIPCODE'] = $billingPostcode; } @@ -79,20 +79,20 @@ public function getBaseData() if ($billingCity = $card->getBillingCity()) { $data['EPS_TOWN'] = $billingCity; } - + if ($billingCountry = $card->getBillingCountry()) { $data['EPS_BILLINGCOUNTRY'] = $billingCountry; } - + if ($shippingCountry = $card->getShippingCountry()) { $data['EPS_DELIVERYCOUNTRY'] = $shippingCountry; } - + if ($emailAddress = $card->getEmail()) { $data['EPS_EMAILADDRESS'] = $emailAddress; } } - + if ($this->getHasEMV3DSEnabled()) { $data['EPS_ORDERID'] = $this->getTransactionReference(); From 767a75ee85aeb1bd1eadfee9aa8e4600d726433a Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Mon, 28 Oct 2024 11:42:58 +0700 Subject: [PATCH 3/4] Fix style guide --- src/Message/DirectPostAbstractRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/DirectPostAbstractRequest.php b/src/Message/DirectPostAbstractRequest.php index d8a8da2..d0d3b84 100644 --- a/src/Message/DirectPostAbstractRequest.php +++ b/src/Message/DirectPostAbstractRequest.php @@ -71,7 +71,7 @@ public function getBaseData() $card = $this->getCard(); - if ($card){ //UnionPay doesn't have card option + if ($card) { //UnionPay doesn't have card option if ($billingPostcode = $card->getBillingPostcode()) { $data['EPS_ZIPCODE'] = $billingPostcode; } From a217bb6bcf05707f980d8fa80d556f69a14b7dc0 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Mon, 28 Oct 2024 11:43:35 +0700 Subject: [PATCH 4/4] fix style guide --- src/Message/DirectPostAbstractRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/DirectPostAbstractRequest.php b/src/Message/DirectPostAbstractRequest.php index d0d3b84..1a7f419 100644 --- a/src/Message/DirectPostAbstractRequest.php +++ b/src/Message/DirectPostAbstractRequest.php @@ -70,7 +70,7 @@ public function getBaseData() } $card = $this->getCard(); - + if ($card) { //UnionPay doesn't have card option if ($billingPostcode = $card->getBillingPostcode()) { $data['EPS_ZIPCODE'] = $billingPostcode;