Settings: Add option to disable walletdetection

This commit is contained in:
Martin Gross
2023-07-11 11:05:09 +02:00
parent b9af34f0fd
commit 451ed221d9
+17 -1
View File
@@ -221,6 +221,20 @@ class StripeSettingsHolder(BasePaymentProvider):
]
extra_fields = [
('walletdetection',
forms.BooleanField(
label=mark_safe(
_('Check for Apple Pay/Google Pay') +
' ' +
'<span class="label label-info">{}</span>'.format(_('experimental'))
),
help_text=_("pretix will attempt to check if the customer's webbrowser supports wallet-based payment "
"methods like Apple Pay or Google Pay and display them prominently with the credit card"
"payment method. This detection does not take into consideration if Google Pay/Apple Pay "
"has been disabled in the Stripe Dashboard."),
initial=True,
required=False,
)),
('postfix',
forms.CharField(
label=_('Statement descriptor postfix'),
@@ -754,7 +768,9 @@ class StripeCC(StripeMethod):
# ToDo: Check against Stripe API, if ApplePay and GooglePay are even activated/available
# This is probably only really feasable once the Payment Methods Configuration API is out of beta
# https://stripe.com/docs/connect/payment-method-configurations
return [WalletQueries.APPLEPAY, WalletQueries.GOOGLEPAY]
if self.settings.get("walletdetection", True, as_type=bool):
return [WalletQueries.APPLEPAY, WalletQueries.GOOGLEPAY]
return []
def payment_form_render(self, request, total) -> str:
account = get_stripe_account_key(self)