Box office payments: Always display device and receipt ID

This commit is contained in:
Raphael Michel
2019-04-05 14:40:58 +02:00
parent 0c82e92882
commit d395db8142
2 changed files with 17 additions and 18 deletions

View File

@@ -721,13 +721,10 @@ class BoxOfficeProvider(BasePaymentProvider):
return False
def payment_control_render(self, request, payment) -> str:
template = None
payment_info = None
if payment.info:
payment_info = json.loads(payment.info)
if payment_info['payment_type'] == "sumup":
template = get_template('pretixcontrol/boxoffice/payment_sumup.html')
if not payment.info:
return
payment_info = json.loads(payment.info)
template = get_template('pretixcontrol/boxoffice/payment.html')
ctx = {
'request': request,
@@ -737,11 +734,7 @@ class BoxOfficeProvider(BasePaymentProvider):
'payment': payment,
'provider': self,
}
if template:
return template.render(ctx)
else:
return
return template.render(ctx)
class ManualPayment(BasePaymentProvider):

View File

@@ -1,11 +1,15 @@
{% load i18n %}
{% if payment_info %}
<dl class="dl-horizontal">
<dl class="dl-horizontal">
<dt>{% trans "Device ID" %}</dt>
<dd>{{ payment_info.pos_id }}</dd>
<dt>{% trans "Receipt ID" %}</dt>
<dd>{{ payment_info.receipt_id }}</dd>
{% if payment_info.payment_type == "sumup" %}
<dt>{% trans "Payment provider" %}</dt>
<dd>SumUp</dd>
<dt>{% trans "Transaction Code" %}</dt>
<dd>{{ payment_info.payment_data.tx_code}}</dd>
<dd>{{ payment_info.payment_data.tx_code }}</dd>
<dt>{% trans "Merchant Code" %}</dt>
<dd>{{ payment_info.payment_data.merchant_code }}</dd>
<dt>{% trans "Currency" %}</dt>
@@ -17,6 +21,8 @@
<dt>{% trans "Card Entry Mode" %}</dt>
<dd>{{ payment_info.payment_data.entry_mode }}</dd>
<dt>{% trans "Card number" %}</dt>
<dd><i class="fa fa-cc-{{ payment_info.payment_data.card_type|lower }}"></i> **** **** **** {{ payment_info.payment_data.last4 }}</dd>
</dl>
{% endif %}
<dd>
<i class="fa fa-cc-{{ payment_info.payment_data.card_type|lower }}"></i> **** **** **** {{ payment_info.payment_data.last4 }}
</dd>
{% endif %}
</dl>