From 75e48db47d8f2cb844af434ce5bf30111eb400db Mon Sep 17 00:00:00 2001 From: Julien Date: Wed, 19 Aug 2020 09:26:45 +0200 Subject: [PATCH] fix bug error 500 on saved cards display in customer account --- classes/StripeCard.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/classes/StripeCard.php b/classes/StripeCard.php index 6c46450..29146f5 100755 --- a/classes/StripeCard.php +++ b/classes/StripeCard.php @@ -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; }