From 89a101dbc5c9d4b30291cb04033abe5ed02b662d Mon Sep 17 00:00:00 2001 From: Stephanus Yanaputra Date: Tue, 2 Apr 2019 14:13:04 +1100 Subject: [PATCH 1/3] Remove card details if TokenCustomerID is provided. Otherwise the card details will overwrite the displayed data. If we are only paying using token, normally we do not have expiry month and year. omnipay-eway automatically generate the month & year to be 12/99 which causes confusion on eWay dashboard. --- src/Message/RapidDirectPurchaseRequest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Message/RapidDirectPurchaseRequest.php b/src/Message/RapidDirectPurchaseRequest.php index ed8003d..22cbc04 100644 --- a/src/Message/RapidDirectPurchaseRequest.php +++ b/src/Message/RapidDirectPurchaseRequest.php @@ -93,6 +93,11 @@ public function getData() $data['Method'] = 'ProcessPayment'; } + if(isset($data['Customer']['TokenCustomerID'])) { + // If we are paying using token, remove the card details otherwise the displayed data will be overwritten on eWay dashboard + unset($data['Customer']['CardDetails']); + } + return $data; } From d465544a3bc083bf8f7604c88acb612d097b6ded Mon Sep 17 00:00:00 2001 From: Stephanus Yanaputra Date: Tue, 2 Apr 2019 14:41:08 +1100 Subject: [PATCH 2/3] Added space after if statement --- src/Message/RapidDirectPurchaseRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/RapidDirectPurchaseRequest.php b/src/Message/RapidDirectPurchaseRequest.php index 22cbc04..4cea4a5 100644 --- a/src/Message/RapidDirectPurchaseRequest.php +++ b/src/Message/RapidDirectPurchaseRequest.php @@ -93,7 +93,7 @@ public function getData() $data['Method'] = 'ProcessPayment'; } - if(isset($data['Customer']['TokenCustomerID'])) { + if (isset($data['Customer']['TokenCustomerID'])) { // If we are paying using token, remove the card details otherwise the displayed data will be overwritten on eWay dashboard unset($data['Customer']['CardDetails']); } From 5caa339dd7448d2a8a7c2a482a3330e4640fff68 Mon Sep 17 00:00:00 2001 From: Stephanus Yanaputra Date: Tue, 2 Apr 2019 15:05:26 +1100 Subject: [PATCH 3/3] Fixed lines --- src/Message/RapidDirectPurchaseRequest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Message/RapidDirectPurchaseRequest.php b/src/Message/RapidDirectPurchaseRequest.php index 4cea4a5..d0af297 100644 --- a/src/Message/RapidDirectPurchaseRequest.php +++ b/src/Message/RapidDirectPurchaseRequest.php @@ -94,7 +94,8 @@ public function getData() } if (isset($data['Customer']['TokenCustomerID'])) { - // If we are paying using token, remove the card details otherwise the displayed data will be overwritten on eWay dashboard + // If we are paying using token, remove the card details + // otherwise the displayed data will be overwritten on eWay dashboard unset($data['Customer']['CardDetails']); }