PProv: Implement detection of wallets such as Google Pay and Apple Pay

This commit is contained in:
Martin Gross
2023-06-30 10:21:22 +02:00
parent 3717c4b553
commit 1b1c4358d3
7 changed files with 165 additions and 4 deletions
+6 -1
View File
@@ -59,7 +59,7 @@ from pretix import __version__
from pretix.base.decimal import round_decimal
from pretix.base.forms import SecretKeySettingsField
from pretix.base.models import Event, OrderPayment, OrderRefund, Quota
from pretix.base.payment import BasePaymentProvider, PaymentException
from pretix.base.payment import BasePaymentProvider, PaymentException, WalletQueries
from pretix.base.plugins import get_all_plugins
from pretix.base.services.mail import SendMailException
from pretix.base.settings import SettingsSandbox
@@ -747,6 +747,11 @@ class StripeCC(StripeMethod):
public_name = _('Credit card')
method = 'cc'
@property
def walletqueries(self):
# ToDo: Check against Stripe API, if ApplePay and GooglePay are even activated/available
return [WalletQueries.APPLEPAY, WalletQueries.GOOGLEPAY]
def payment_form_render(self, request, total) -> str:
account = get_stripe_account_key(self)
if not RegisteredApplePayDomain.objects.filter(account=account, domain=request.host).exists():