Stripe: Disable SOFORT (#4616)

* Stripe: Disable SOFORT

* Update src/pretix/plugins/stripe/payment.py

Co-authored-by: Raphael Michel <michel@rami.io>

---------

Co-authored-by: Martin Gross <gross@rami.io>
This commit is contained in:
Raphael Michel
2024-11-18 17:24:01 +01:00
committed by GitHub
parent 03d3c389da
commit 5034b366c5

View File

@@ -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 = {