From 451ed221d9ab213febba27a94ccd8f37b3fd5a6f Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Tue, 11 Jul 2023 11:05:09 +0200 Subject: [PATCH] Settings: Add option to disable walletdetection --- src/pretix/plugins/stripe/payment.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/pretix/plugins/stripe/payment.py b/src/pretix/plugins/stripe/payment.py index 98a246b60f..c648d64e53 100644 --- a/src/pretix/plugins/stripe/payment.py +++ b/src/pretix/plugins/stripe/payment.py @@ -221,6 +221,20 @@ class StripeSettingsHolder(BasePaymentProvider): ] extra_fields = [ + ('walletdetection', + forms.BooleanField( + label=mark_safe( + _('Check for Apple Pay/Google Pay') + + ' ' + + '{}'.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)