From e10eb78ac8d87fc07fda60be8610cdf97635b307 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 9 Nov 2022 22:36:05 +1100 Subject: [PATCH] Fixes for SEPA auto-billing --- app/PaymentDrivers/Stripe/Charge.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/Stripe/Charge.php b/app/PaymentDrivers/Stripe/Charge.php index eb6bc14558e3..691f6ca5bb13 100644 --- a/app/PaymentDrivers/Stripe/Charge.php +++ b/app/PaymentDrivers/Stripe/Charge.php @@ -137,9 +137,6 @@ class Charge return false; } - if($response?->status != 'succeeded') - $this->stripe->processInternallyFailedPayment($this->stripe, new \Exception('Auto billing failed.',400)); - if ($cgt->gateway_type_id == GatewayType::SEPA) { $payment_method_type = PaymentType::SEPA; $status = Payment::STATUS_PENDING; @@ -148,6 +145,12 @@ class Charge $status = Payment::STATUS_COMPLETED; } + if($response?->status == 'processing'){ + //allows us to jump over the next stage - used for SEPA + }elseif($response?->status != 'succeeded'){ + $this->stripe->processInternallyFailedPayment($this->stripe, new \Exception('Auto billing failed.',400)); + } + $data = [ 'gateway_type_id' => $cgt->gateway_type_id, 'payment_type' => $this->transformPaymentTypeToConstant($payment_method_type),