mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Stripe: Support for TWINT (#4216)
* Stripe: Support for TWINT * Update src/pretix/plugins/stripe/payment.py Co-authored-by: Richard Schreiber <schreiber@rami.io> --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -116,6 +116,7 @@ logger = logging.getLogger('pretix.plugins.stripe')
|
||||
# - PayNow: ✗
|
||||
# - UPI: ✗
|
||||
# - Netbanking: ✗
|
||||
# - TWINT: ✓
|
||||
#
|
||||
# Bank transfers
|
||||
# - ACH Bank Transfer: ✗
|
||||
@@ -448,6 +449,14 @@ class StripeSettingsHolder(BasePaymentProvider):
|
||||
'before they work properly.'),
|
||||
required=False,
|
||||
)),
|
||||
('method_twint',
|
||||
forms.BooleanField(
|
||||
label='TWINT',
|
||||
disabled=self.event.currency != 'CHF',
|
||||
help_text=_('Some payment methods might need to be enabled in the settings of your Stripe account '
|
||||
'before they work properly.'),
|
||||
required=False,
|
||||
)),
|
||||
('method_affirm',
|
||||
forms.BooleanField(
|
||||
label=_('Affirm'),
|
||||
@@ -1793,3 +1802,25 @@ class StripeSwish(StripeRedirectMethod):
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class StripeTwint(StripeRedirectMethod):
|
||||
identifier = 'stripe_twint'
|
||||
verbose_name = _('TWINT via Stripe')
|
||||
public_name = 'TWINT'
|
||||
method = 'twint'
|
||||
confirmation_method = 'automatic'
|
||||
explanation = _(
|
||||
'This payment method is available to users of the Swiss app TWINT. Please have your app '
|
||||
'ready.'
|
||||
)
|
||||
|
||||
def is_allowed(self, request: HttpRequest, total: Decimal=None) -> bool:
|
||||
return super().is_allowed(request, total) and request.event.currency == "CHF" and total <= Decimal("5000.00")
|
||||
|
||||
def _payment_intent_kwargs(self, request, payment):
|
||||
return {
|
||||
"payment_method_data": {
|
||||
"type": "twint",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user