From 5dc3792fb44eb6e1b67b2997e99b3860958cef31 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 10 Jan 2021 23:23:53 +1300 Subject: [PATCH] Do not treat an empty card as a provided card Wiping out the whole array is pretty extreme. Only do it if the card array actually has meaningful values. The code that calls this might be trying to support multiple processors so don't assume it 'knows' not to pass an empty card if the processor is sagepay https://github.com/thephpleague/omnipay-sagepay/issues/157#issuecomment-757448484 --- src/Message/SharedRepeatAuthorizeRequest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Message/SharedRepeatAuthorizeRequest.php b/src/Message/SharedRepeatAuthorizeRequest.php index 23331684..a902c25d 100644 --- a/src/Message/SharedRepeatAuthorizeRequest.php +++ b/src/Message/SharedRepeatAuthorizeRequest.php @@ -69,8 +69,7 @@ public function getData() $card = $this->getCard(); // If a card is provided, then assume all billing details are being updated. - - if ($card) { + if ($card && !empty($card->getParameters()) && !empty(array_filter($card->getParameters()))) { $data = $this->getBillingAddressData($data); // If the customer is present, then the CV2 can be supplied again for extra security.