Skip to content

Commit

Permalink
Do not treat an empty card as a provided card
Browse files Browse the repository at this point in the history
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

thephpleague#157 (comment)
  • Loading branch information
eileenmcnaughton committed Jan 10, 2021
1 parent 49f5dec commit d92bfdc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Message/SharedRepeatAuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d92bfdc

Please sign in to comment.