Skip to content

Commit

Permalink
Remove ? from billingAddress in PaymentMethod toArray
Browse files Browse the repository at this point in the history
  • Loading branch information
gitwilliam committed Aug 24, 2023
1 parent 3ea1d4c commit d3223c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Model/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ public function setBillingAddress(Address $address): self

public function toArray(): array
{
if (!isset($this->billingAddress)) {
return [];
}

// If the last4, name, and type are added to this, then they
// will need to be stripped off prior to it being submitted to
// Braintree as part of a subscription in PaymentMethodMapper::toRequest.
return [
'billingAddress' => $this->billingAddress?->toArray(),
'billingAddress' => $this->billingAddress->toArray(),
];
}

Expand Down

0 comments on commit d3223c3

Please sign in to comment.