From 5f3d48e189dca6e62235793f61811bb3efd8019e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 2 Sep 2022 07:36:41 +1000 Subject: [PATCH] Check for valid bank account property before attempting to iterate --- app/PaymentDrivers/Stripe/UpdatePaymentMethods.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/PaymentDrivers/Stripe/UpdatePaymentMethods.php b/app/PaymentDrivers/Stripe/UpdatePaymentMethods.php index b561733347..860b590602 100644 --- a/app/PaymentDrivers/Stripe/UpdatePaymentMethods.php +++ b/app/PaymentDrivers/Stripe/UpdatePaymentMethods.php @@ -74,6 +74,9 @@ class UpdatePaymentMethods { $sources = $customer->sources; + if(!property_exists($sources, 'data')) + return; + foreach ($sources->data as $method) { $token_exists = ClientGatewayToken::where([ 'gateway_customer_reference' => $customer->id,