Compare commits

...

4 Commits

Author SHA1 Message Date
Martin Gross
4da34d2977 Fix MobilePay spelling 2024-11-18 15:02:57 +01:00
Martin Gross
2e6eb167e1 Update src/pretix/plugins/stripe/payment.py
Co-authored-by: robbi5 <richt@rami.io>
2024-11-18 14:16:50 +01:00
Martin Gross
495bc3ecc9 isort 2024-11-18 13:53:06 +01:00
Martin Gross
8bb3a95ce6 Stripe: Add MobilePay as a supported payment method 2024-11-18 13:50:33 +01:00
2 changed files with 27 additions and 4 deletions

View File

@@ -152,7 +152,7 @@ logger = logging.getLogger('pretix.plugins.stripe')
# - Link: ✓ (PaymentRequestButton)
# - Cash App Pay: ✗
# - PayPal: ✓ (No settings UI yet)
# - MobilePay:
# - MobilePay:
# - Alipay: ✓
# - WeChat Pay: ✓
# - GrabPay: ✓
@@ -494,6 +494,11 @@ class StripeSettingsHolder(BasePaymentProvider):
# 'EUR', 'GBP', 'USD', 'CHF', 'CZK', 'DKK', 'NOK', 'PLN', 'SEK', 'AUD', 'CAD', 'HKD', 'NZD', 'SGD'
# ]
# )),
('method_mobilepay',
forms.BooleanField(
label=_('MobilePay'),
disabled=self.event.currency not in ['DKK', 'EUR', 'NOK', 'SEK'],
)),
] + extra_fields + list(super().settings_form_fields.items()) + moto_settings
)
if not self.settings.connect_client_id or self.settings.secret_key:
@@ -1853,3 +1858,21 @@ class StripeTwint(StripeRedirectMethod):
"type": "twint",
},
}
class StripeMobilePay(StripeRedirectMethod):
identifier = 'stripe_mobilepay'
verbose_name = 'MobilePay via Stripe'
public_name = 'MobilePay'
method = 'mobilepay'
confirmation_method = 'automatic'
explanation = _(
'This payment method is available to MobilePay app users in Denmark and Finland. Please have your app ready.'
)
def _payment_intent_kwargs(self, request, payment):
return {
"payment_method_data": {
"type": "mobilepay",
},
}

View File

@@ -46,8 +46,8 @@ from pretix.presale.signals import html_head, process_response
def register_payment_provider(sender, **kwargs):
from .payment import (
StripeAffirm, StripeAlipay, StripeBancontact, StripeCC, StripeEPS,
StripeGiropay, StripeIdeal, StripeKlarna, StripeMultibanco,
StripePayPal, StripePrzelewy24, StripeRevolutPay,
StripeGiropay, StripeIdeal, StripeKlarna, StripeMobilePay,
StripeMultibanco, StripePayPal, StripePrzelewy24, StripeRevolutPay,
StripeSEPADirectDebit, StripeSettingsHolder, StripeSofort, StripeSwish,
StripeTwint, StripeWeChatPay,
)
@@ -55,7 +55,7 @@ def register_payment_provider(sender, **kwargs):
return [
StripeSettingsHolder, StripeCC, StripeGiropay, StripeIdeal, StripeAlipay, StripeBancontact,
StripeSofort, StripeEPS, StripeMultibanco, StripePrzelewy24, StripeRevolutPay, StripeWeChatPay,
StripeSEPADirectDebit, StripeAffirm, StripeKlarna, StripePayPal, StripeSwish, StripeTwint,
StripeSEPADirectDebit, StripeAffirm, StripeKlarna, StripePayPal, StripeSwish, StripeTwint, StripeMobilePay
]