From 2d4e5817e6f4ba5f1d15bc556e9eb7d2b592434a Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Thu, 26 Sep 2024 14:04:18 +0200 Subject: [PATCH] Avoid stripe resuccess on redirect handling --- src/Library/Economy/Payment/StripeGateway.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Library/Economy/Payment/StripeGateway.php b/src/Library/Economy/Payment/StripeGateway.php index ab8a64e..fd2b1b0 100644 --- a/src/Library/Economy/Payment/StripeGateway.php +++ b/src/Library/Economy/Payment/StripeGateway.php @@ -105,6 +105,10 @@ class StripeGateway implements GatewayInterface throw new \Exception(sprintf("Stripe checkout '%s' exists but no GatewayCheckout with that reference was found.", $sessionId)); } + if ($checkout->getStatus() === GatewayCheckoutStatus::Charged) { + return $checkout; + } + if ($request->query->get('type') !== GatewayCheckoutService::RESPONSE_TYPE_SUCCESS) { return $checkout; }