Self-service cancellation: Allow to disable auto-refunds

This commit is contained in:
Raphael Michel
2021-09-15 13:43:28 +02:00
parent 848ea999c5
commit 61649ab2b8
4 changed files with 14 additions and 5 deletions

View File

@@ -1440,6 +1440,7 @@ DEFAULTS = {
('off', _('All refunds are issued to the original payment method')),
('option', _('Customers can choose between a gift card and a refund to their payment method')),
('force', _('All refunds are issued as gift cards')),
('manually', _('Do not handle refunds automatically at all')),
],
),
'form_class': forms.ChoiceField,
@@ -1449,6 +1450,7 @@ DEFAULTS = {
('off', _('All refunds are issued to the original payment method')),
('option', _('Customers can choose between a gift card and a refund to their payment method')),
('force', _('All refunds are issued as gift cards')),
('manually', _('Do not handle refunds automatically at all')),
],
widget=forms.RadioSelect,
# When adding a new ordering, remember to also define it in the event model

View File

@@ -397,7 +397,7 @@
{% trans "The refund will be issued in form of a gift card that you can use for further purchases." %}
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "option" %}
{% trans "The refund can be issued to your original payment method or as a gift card." %}
{% else %}
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard != "manually" %}
{% trans "The refund will be issued to your original payment method." %}
{% endif %}
{% trans "This will invalidate all tickets in this order." %}
@@ -418,7 +418,7 @@
{% trans "The refund will be issued in form of a gift card that you can use for further purchases." %}
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "option" %}
{% trans "The refund can be issued to your original payment method or as a gift card." %}
{% else %}
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard != "manually" %}
{% trans "The refund will be issued to your original payment method." %}
{% endif %}
{% trans "This will invalidate all tickets in this order." %}

View File

@@ -84,7 +84,11 @@
{% endif %}
{% if refund_amount %}
{% if request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "force" %}
{% if request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "manually" %}
<strong>
{% trans "The organizer will get in touch with you to clarify the details of your refund." %}
</strong>
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "force" %}
<strong>
{% trans "The refund will be issued in form of a gift card that you can use for further purchases." %}
</strong>

View File

@@ -873,11 +873,14 @@ class OrderCancelDo(EventViewMixin, OrderDetailMixin, AsyncAction, View):
return redirect(self.get_order_url())
fee = None
require_approval = False
auto_refund = not self.request.event.settings.cancel_allow_user_paid_require_approval
auto_refund = (
not self.request.event.settings.cancel_allow_user_paid_require_approval
and self.request.event.settings.cancel_allow_user_paid_refund_as_giftcard != "manually"
)
if self.order.status == Order.STATUS_PAID and self.order.total != Decimal('0.00'):
require_approval = self.request.event.settings.cancel_allow_user_paid_require_approval
fee = self.order.user_cancel_fee
auto_refund = True
auto_refund = self.request.event.settings.cancel_allow_user_paid_refund_as_giftcard != "manually"
if self.order.total == Decimal('0.00'):
fee = Decimal('0.00')
elif 'cancel_fee' in request.POST and self.request.event.settings.cancel_allow_user_paid_adjust_fees: