From 5034b366c5352b1d4e3dd819d7c72fb4bd308939 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 18 Nov 2024 17:24:01 +0100 Subject: [PATCH] Stripe: Disable SOFORT (#4616) * Stripe: Disable SOFORT * Update src/pretix/plugins/stripe/payment.py Co-authored-by: Raphael Michel --------- Co-authored-by: Martin Gross --- src/pretix/plugins/stripe/payment.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pretix/plugins/stripe/payment.py b/src/pretix/plugins/stripe/payment.py index 7eebd1731..10cc72caf 100644 --- a/src/pretix/plugins/stripe/payment.py +++ b/src/pretix/plugins/stripe/payment.py @@ -113,7 +113,7 @@ logger = logging.getLogger('pretix.plugins.stripe') # - giropay: (deprecated) # - iDEAL: ✓ # - P24: ✓ -# - Sofort: ✓ +# - Sofort: (deprecated) # - FPX: ✗ # - PayNow: ✗ # - UPI: ✗ @@ -1605,6 +1605,17 @@ class StripeSofort(StripeRedirectMethod): method = 'sofort' redirect_in_widget_allowed = False + def is_allowed(self, request: HttpRequest, total: Decimal=None) -> bool: + # Stripe<>Sofort is shut down November 29th + return super().is_allowed(request, total) and now() < datetime( + 2024, 11, 29, 0, 0, 0, tzinfo=zoneinfo.ZoneInfo("Europe/Berlin") + ) + + def order_change_allowed(self, order: Order, request: HttpRequest=None) -> bool: + return super().order_change_allowed(order, request) and now() < datetime( + 2024, 11, 29, 0, 0, 0, tzinfo=zoneinfo.ZoneInfo("Europe/Berlin") + ) + def payment_form_render(self, request) -> str: template = get_template('pretixplugins/stripe/checkout_payment_form_simple.html') ctx = {