Stripe: Add support for Swish (#4149)

* Stripe: Add support for Swish

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

Co-authored-by: Martin Gross <gross@rami.io>

---------

Co-authored-by: Martin Gross <gross@rami.io>
This commit is contained in:
Raphael Michel
2024-05-17 13:33:03 +02:00
committed by GitHub
parent a6a93555b6
commit 7188e44fe5
3 changed files with 40 additions and 4 deletions

View File

@@ -599,7 +599,8 @@ class ScaView(StripeOrderView, View):
return self._redirect_to_order()
if intent.status == 'requires_action' and intent.next_action.type in [
'use_stripe_sdk', 'redirect_to_url', 'alipay_handle_redirect', 'wechat_pay_display_qr_code'
'use_stripe_sdk', 'redirect_to_url', 'alipay_handle_redirect', 'wechat_pay_display_qr_code',
'swish_handle_redirect_or_display_qr_code',
]:
ctx = {
'order': self.order,
@@ -611,6 +612,9 @@ class ScaView(StripeOrderView, View):
elif intent.next_action.type == 'redirect_to_url':
ctx['payment_intent_next_action_redirect_url'] = intent.next_action.redirect_to_url['url']
ctx['payment_intent_redirect_action_handling'] = prov.redirect_action_handling
elif intent.next_action.type == 'swish_handle_redirect_or_display_qr_code':
ctx['payment_intent_next_action_redirect_url'] = intent.next_action.swish_handle_redirect_or_display_qr_code['hosted_instructions_url']
ctx['payment_intent_redirect_action_handling'] = 'iframe'
r = render(request, 'pretixplugins/stripe/sca.html', ctx)
r._csp_ignore = True