forked from CGM_Public/pretix_original
Revert "Optional MOTO-Flagging for Reseller Scheme-TXs (#1570)"
This reverts commit 0a920ac21c.
This commit is contained in:
@@ -25,7 +25,6 @@ from pretix import __version__
|
|||||||
from pretix.base.decimal import round_decimal
|
from pretix.base.decimal import round_decimal
|
||||||
from pretix.base.models import Event, OrderPayment, OrderRefund, Quota
|
from pretix.base.models import Event, OrderPayment, OrderRefund, Quota
|
||||||
from pretix.base.payment import BasePaymentProvider, PaymentException
|
from pretix.base.payment import BasePaymentProvider, PaymentException
|
||||||
from pretix.base.plugins import get_all_plugins
|
|
||||||
from pretix.base.services.mail import SendMailException
|
from pretix.base.services.mail import SendMailException
|
||||||
from pretix.base.settings import SettingsSandbox
|
from pretix.base.settings import SettingsSandbox
|
||||||
from pretix.helpers.urls import build_absolute_uri as build_global_uri
|
from pretix.helpers.urls import build_absolute_uri as build_global_uri
|
||||||
@@ -98,30 +97,6 @@ class StripeSettingsHolder(BasePaymentProvider):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def settings_form_fields(self):
|
def settings_form_fields(self):
|
||||||
if 'pretix_resellers' in [p.module for p in get_all_plugins()]:
|
|
||||||
moto_settings = [
|
|
||||||
('reseller_moto',
|
|
||||||
forms.BooleanField(
|
|
||||||
label=_('Enable MOTO payments for resellers'),
|
|
||||||
help_text=(
|
|
||||||
_('Gated feature (needs to be enabled for your account by Stripe support first)') +
|
|
||||||
'<div class="alert alert-danger">%s</div>' % _(
|
|
||||||
'We can flag the credit card transaction you make through the reseller interface as MOTO '
|
|
||||||
'(Mail Order / Telephone Order), which will exempt them from Strong Customer '
|
|
||||||
'Authentication (SCA) requirements. However: By enabling this feature, you will need to '
|
|
||||||
'fill out yearly PCI-DSS self-assessment forms like the 40 page SAQ D. Please consult the '
|
|
||||||
'%s for further information on this subject.' %
|
|
||||||
'<a href="https://stripe.com/docs/security">{}</a>'.format(
|
|
||||||
_('Stripe Integration security guide')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
required=False,
|
|
||||||
))
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
moto_settings = []
|
|
||||||
|
|
||||||
if self.settings.connect_client_id and not self.settings.secret_key:
|
if self.settings.connect_client_id and not self.settings.secret_key:
|
||||||
# Stripe connect
|
# Stripe connect
|
||||||
if self.settings.connect_user_id:
|
if self.settings.connect_user_id:
|
||||||
@@ -253,7 +228,7 @@ class StripeSettingsHolder(BasePaymentProvider):
|
|||||||
help_text=_('Needs to be enabled in your Stripe account first.'),
|
help_text=_('Needs to be enabled in your Stripe account first.'),
|
||||||
required=False,
|
required=False,
|
||||||
)),
|
)),
|
||||||
] + list(super().settings_form_fields.items()) + moto_settings
|
] + list(super().settings_form_fields.items())
|
||||||
)
|
)
|
||||||
d.move_to_end('_enabled', last=False)
|
d.move_to_end('_enabled', last=False)
|
||||||
return d
|
return d
|
||||||
@@ -634,7 +609,6 @@ class StripeCC(StripeMethod):
|
|||||||
'event': self.event,
|
'event': self.event,
|
||||||
'total': self._decimal_to_int(total),
|
'total': self._decimal_to_int(total),
|
||||||
'settings': self.settings,
|
'settings': self.settings,
|
||||||
'is_moto': self.is_moto(request)
|
|
||||||
}
|
}
|
||||||
return template.render(ctx)
|
return template.render(ctx)
|
||||||
|
|
||||||
@@ -657,20 +631,6 @@ class StripeCC(StripeMethod):
|
|||||||
finally:
|
finally:
|
||||||
del request.session['payment_stripe_payment_method_id']
|
del request.session['payment_stripe_payment_method_id']
|
||||||
|
|
||||||
def is_moto(self, request, payment=None) -> bool:
|
|
||||||
# We don't have a payment yet when checking if we should display the MOTO-flag
|
|
||||||
# However, before we execute the payment, we absolutely have to check if the request-SalesChannel as well as the
|
|
||||||
# order are tagged as a reseller-transaction. Else, a user with a valid reseller-session might be able to place
|
|
||||||
# a MOTO transaction trough the WebShop.
|
|
||||||
|
|
||||||
moto = self.settings.get('reseller_moto', False, as_type=bool) and \
|
|
||||||
request.sales_channel.identifier == 'resellers'
|
|
||||||
|
|
||||||
if payment:
|
|
||||||
return moto and payment.order.sales_channel == 'resellers'
|
|
||||||
|
|
||||||
return moto
|
|
||||||
|
|
||||||
def _handle_payment_intent(self, request, payment, intent=None):
|
def _handle_payment_intent(self, request, payment, intent=None):
|
||||||
self._init_api()
|
self._init_api()
|
||||||
|
|
||||||
@@ -683,11 +643,6 @@ class StripeCC(StripeMethod):
|
|||||||
amount=self._get_amount(payment),
|
amount=self._get_amount(payment),
|
||||||
currency=self.event.currency.lower(),
|
currency=self.event.currency.lower(),
|
||||||
payment_method=request.session['payment_stripe_payment_method_id'],
|
payment_method=request.session['payment_stripe_payment_method_id'],
|
||||||
payment_method_options={
|
|
||||||
'card': {
|
|
||||||
'moto': self.is_moto(request, payment),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
confirmation_method='manual',
|
confirmation_method='manual',
|
||||||
confirm=True,
|
confirm=True,
|
||||||
description='{event}-{code}'.format(
|
description='{event}-{code}'.format(
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ def pretixcontrol_logentry_display(sender, logentry, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
settings_hierarkey.add_default('payment_stripe_method_cc', True, bool)
|
settings_hierarkey.add_default('payment_stripe_method_cc', True, bool)
|
||||||
settings_hierarkey.add_default('payment_stripe_reseller_moto', False, bool)
|
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_global_settings, dispatch_uid='stripe_global_settings')
|
@receiver(register_global_settings, dispatch_uid='stripe_global_settings')
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<div class="form-horizontal stripe-container">
|
<div class="form-horizontal stripe-container">
|
||||||
{% if is_moto %}
|
|
||||||
<h1>
|
|
||||||
<span class="label label-info pull-right flip" data-toggle="tooltip_html" title="{% trans "This transaction will be marked as Mail Order/Telephone Order, exempting it from Strong Customer Authentication (SCA) whenever possible" %}">MOTO</span>
|
|
||||||
</h1>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="stripe-errors sr-only">
|
<div class="stripe-errors sr-only">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user