diff --git a/src/pretix/plugins/stripe/migrations/0004_auto_20211208_1407.py b/src/pretix/plugins/stripe/migrations/0004_auto_20211208_1407.py new file mode 100644 index 0000000000..2501e6eeab --- /dev/null +++ b/src/pretix/plugins/stripe/migrations/0004_auto_20211208_1407.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.2 on 2021-12-08 14:07 +from django.core.cache import cache +from django.db import migrations + + +def cleanup(app, schema_editor): + EventSettingsStore = app.get_model('pretixbase', 'Event_SettingsStore') + for setting in EventSettingsStore.objects.filter(key='payment_stripe_method_cc'): + setting.key = 'payment_stripe_method_card' + cache.delete('hierarkey_{}_{}'.format('event', setting.object_id)) + setting.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('stripe', '0003_registeredapplepaydomain'), + ] + + operations = [ + migrations.RunPython(cleanup, migrations.RunPython.noop) + ] diff --git a/src/pretix/plugins/stripe/payment.py b/src/pretix/plugins/stripe/payment.py index c648d64e53..dddd2bc3da 100644 --- a/src/pretix/plugins/stripe/payment.py +++ b/src/pretix/plugins/stripe/payment.py @@ -58,7 +58,10 @@ from django_countries import countries 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.forms.questions import guess_country +from pretix.base.models import ( + Event, InvoiceAddress, Order, OrderPayment, OrderRefund, Quota, +) from pretix.base.payment import ( BasePaymentProvider, PaymentException, WalletQueries, ) @@ -66,6 +69,8 @@ from pretix.base.plugins import get_all_plugins from pretix.base.services.mail import SendMailException from pretix.base.settings import SettingsSandbox from pretix.helpers import OF_SELF +from pretix.helpers.countries import CachedCountries +from pretix.helpers.http import get_client_ip from pretix.helpers.urls import build_absolute_uri as build_global_uri from pretix.multidomain.urlreverse import build_absolute_uri, eventreverse from pretix.plugins.stripe.forms import StripeKeyValidator @@ -75,9 +80,73 @@ from pretix.plugins.stripe.models import ( from pretix.plugins.stripe.tasks import ( get_stripe_account_key, stripe_verify_domain, ) +from pretix.presale.views.cart import cart_session logger = logging.getLogger('pretix.plugins.stripe') +# State of the payment methods +# +# Source: https://stripe.com/docs/payments/payment-methods/overview +# Last Update: 2023-04-24 +# +# Cards +# - Credit and Debit Cards: ✓ +# - Apple, Google Pay: ✓ +# +# Bank debits +# - ACH Debit: ✗ +# - Canadian PADs: ✗ +# - BACS Direct Debit: ✗ +# - SEPA Direct Debit: ✓ +# - BECS Direct Debit: ✗ +# +# Bank redirects +# - Bancontact: ✓ +# - BLIK: ✗ +# - EPS: ✓ +# - giropay: ✓ +# - iDEAL: ✓ +# - P24: ✓ +# - Sofort: ✓ +# - FPX: ✗ +# - PayNow: ✗ +# - UPI: ✗ +# - Netbanking: ✗ +# +# Bank transfers +# - ACH Bank Transfer: ✗ +# - SEPA Bank Transfer: ✗ +# - UK Bank Transfer: ✗ +# - Multibanco: ✗ +# - Furikomi (Japan): ✗ +# - Mexico Bank Transfer: ✗ +# +# Buy now, pay later +# - Affirm: ✗ +# - Afterpay/Clearpay: ✗ +# - Klarna: ✗ +# +# Real-time payments +# - PayNow: ✗ +# - PromptPay: ✗ +# - Pix: ✗ +# +# Vouchers +# - Konbini: ✗ +# - OXXO: ✗ +# - Boleto: ✗ +# +# Wallets +# - Apple Pay: ✓ (Cards) +# - Google Pay: ✓ (Cards) +# - Secure Remote Commerce: ✗ +# - Link: ✓ (PaymentRequestButton) +# - Cash App Pay: ✗ +# - MobilePay: ✗ +# - Alipay: ✓ +# - WeChat Pay: ✓ +# - GrabPay: ✓ + class StripeSettingsHolder(BasePaymentProvider): identifier = 'stripe_settings' @@ -250,7 +319,7 @@ class StripeSettingsHolder(BasePaymentProvider): d = OrderedDict( fields + [ - ('method_cc', + ('method_card', forms.BooleanField( label=_('Credit card payments'), required=False, @@ -283,6 +352,32 @@ class StripeSettingsHolder(BasePaymentProvider): help_text=_('Needs to be enabled in your Stripe account first.'), required=False, )), + ('method_sepa_debit', + forms.BooleanField( + label=_('SEPA Direct Debit'), + disabled=self.event.currency != 'EUR', + help_text=( + _('Needs to be enabled in your Stripe account first.') + + '
{% blocktrans trimmed %} The total amount will be withdrawn from your credit card. {% endblocktrans %}
{% blocktrans trimmed %} + The total amount will be withdrawn from your bank account. + {% endblocktrans %}
+{% blocktrans trimmed %} diff --git a/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html b/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_card.html similarity index 73% rename from src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html rename to src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_card.html index a0a5cc8365..45200d10c4 100644 --- a/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html +++ b/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_card.html @@ -3,7 +3,7 @@
{% blocktrans trimmed %} You already entered a card number that we will use to charge the payment amount. {% endblocktrans %}
{% blocktrans trimmed %} + You already entered a bank account that we will use to charge the payment amount. + {% endblocktrans %}
++ {% blocktrans trimmed with sepa_creditor_name=settings.sepa_creditor_name %} + By providing your payment information and confirming this payment, you authorise (A) + {{ sepa_creditor_name }} and Stripe, our payment service provider and/or PPRO, its local service provider, + to send instructions to your bank to debit your account and (B) your bank to debit your account in + accordance with those instructions. As part of your rights, you are entitled to a refund from your bank + under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks + starting from the date on which your account was debited. Your rights are explained in a statement that you + can obtain from your bank. You agree to receive notifications for future debits up to 2 days before they + occur. + {% endblocktrans %} + + + + + +
+