Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix bug error 500 on saved cards display in customer account
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoarau committed Aug 19, 2020
1 parent 8ad15f7 commit 75e48db
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions classes/StripeCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ public function delete()

public function getAllCustomerCards()
{
$allCards = \Stripe\PaymentMethod::all([
'customer' => $this->stripe_customer_key,
'type' => 'card',
]);
try {
$allCards = \Stripe\PaymentMethod::all([
'customer' => $this->stripe_customer_key,
'type' => 'card',
]);
} catch (Exception $e) {
return array();
}

return $allCards->data;
}
Expand Down

0 comments on commit 75e48db

Please sign in to comment.