Stripe: Add Revolut Pay (#4366)

* Stripe: Add Revolut Pay

* Remove is_enabled flag
This commit is contained in:
Raphael Michel
2024-08-01 17:20:42 +02:00
committed by GitHub
parent 11e04ea3f2
commit 9946da57c2
2 changed files with 30 additions and 4 deletions

View File

@@ -435,6 +435,14 @@ class StripeSettingsHolder(BasePaymentProvider):
'before they work properly.'),
required=False,
)),
('method_revolut_pay',
forms.BooleanField(
label='Revolut Pay',
disabled=self.event.currency not in ['EUR', 'GBP'],
help_text=_('Some payment methods might need to be enabled in the settings of your Stripe account '
'before they work properly.'),
required=False,
)),
('method_swish',
forms.BooleanField(
label=_('Swish'),
@@ -1776,6 +1784,24 @@ class StripeWeChatPay(StripeRedirectMethod):
}
class StripeRevolutPay(StripeRedirectMethod):
verbose_name = _('Revolut Pay via Stripe')
public_name = _('Revolut Pay')
method = 'revolut_pay'
confirmation_method = 'automatic'
explanation = _(
'This payment method is available to users of the Revolut app. Please keep your login information '
'available.'
)
def _payment_intent_kwargs(self, request, payment):
return {
"payment_method_data": {
"type": "revolut_pay",
},
}
class StripePayPal(StripeRedirectMethod):
identifier = 'stripe_paypal'
verbose_name = _('PayPal via Stripe')

View File

@@ -47,14 +47,14 @@ def register_payment_provider(sender, **kwargs):
from .payment import (
StripeAffirm, StripeAlipay, StripeBancontact, StripeCC, StripeEPS,
StripeGiropay, StripeIdeal, StripeKlarna, StripeMultibanco,
StripePayPal, StripePrzelewy24, StripeSEPADirectDebit,
StripeSettingsHolder, StripeSofort, StripeSwish, StripeTwint,
StripeWeChatPay,
StripePayPal, StripePrzelewy24, StripeRevolutPay,
StripeSEPADirectDebit, StripeSettingsHolder, StripeSofort, StripeSwish,
StripeTwint, StripeWeChatPay,
)
return [
StripeSettingsHolder, StripeCC, StripeGiropay, StripeIdeal, StripeAlipay, StripeBancontact,
StripeSofort, StripeEPS, StripeMultibanco, StripePrzelewy24, StripeWeChatPay,
StripeSofort, StripeEPS, StripeMultibanco, StripePrzelewy24, StripeRevolutPay, StripeWeChatPay,
StripeSEPADirectDebit, StripeAffirm, StripeKlarna, StripePayPal, StripeSwish, StripeTwint,
]