From e77da2efc1629376c684768807a076437bf13ace Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Fri, 13 Mar 2026 02:42:22 +0000 Subject: [PATCH] Stripe - refine invoice handling & status mapping (#3323) --- src/library/Payment/Adapter/Stripe.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/library/Payment/Adapter/Stripe.php b/src/library/Payment/Adapter/Stripe.php index e9dd8d286..99f695f88 100644 --- a/src/library/Payment/Adapter/Stripe.php +++ b/src/library/Payment/Adapter/Stripe.php @@ -180,7 +180,7 @@ class Payment_Adapter_Stripe implements FOSSBilling\InjectionAwareInterface $invoiceService->approveInvoice($invoice, ['use_credits' => false]); } $invoiceService->payInvoiceWithCredits($invoice); - } else { + } elseif (!$tx->invoice_id) { $invoiceService->doBatchPayWithCredits(['client_id' => $client->id]); } } @@ -193,14 +193,14 @@ class Payment_Adapter_Stripe implements FOSSBilling\InjectionAwareInterface $paymentStatus = match ($charge->status) { 'succeeded' => 'processed', 'requires_action' => 'received', - 'requires_payment_method' => 'received', 'requires_confirmation' => 'received', 'requires_capture' => 'received', 'processing' => 'received', 'pending' => 'received', + 'requires_payment_method' => 'error', 'canceled' => 'error', 'failed' => 'error', - default => 'received', + default => 'error', }; $tx->status = $paymentStatus;