From f11452aea96301935b59679c7160f1416e248481 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 13 Mar 2024 16:42:33 +1100 Subject: [PATCH 1/2] Ensure square object existing --- app/PaymentDrivers/Square/CreditCard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/PaymentDrivers/Square/CreditCard.php b/app/PaymentDrivers/Square/CreditCard.php index 167744331d76..da53d36a2610 100644 --- a/app/PaymentDrivers/Square/CreditCard.php +++ b/app/PaymentDrivers/Square/CreditCard.php @@ -271,7 +271,7 @@ class CreditCard implements MethodInterface $errors = $api_response->getErrors(); } - if (property_exists($customers, 'customers')) { + if ($customers && property_exists($customers, 'customers')) { return $customers->customers[0]->id; } From e54a28b857cc4f016dba3d0f69c9668317fffe38 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 13 Mar 2024 16:57:22 +1100 Subject: [PATCH 2/2] Catch deleted / Archived gateways --- app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php b/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php index ea757faca88e..6cca5ba8e3a0 100644 --- a/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php +++ b/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php @@ -89,6 +89,10 @@ class PaymentIntentWebhook implements ShouldQueue } $company_gateway = CompanyGateway::query()->find($this->company_gateway_id); + + if(!$company_gateway) + return; + $stripe_driver = $company_gateway->driver()->init(); $charge_id = false;