Bank transfer: Add optional text to pending payments

This commit is contained in:
Raphael Michel
2020-11-20 14:10:20 +01:00
parent 6c1fa8cf2d
commit 168a6bae98
2 changed files with 13 additions and 1 deletions

View File

@@ -122,7 +122,14 @@ class BankTransfer(BasePaymentProvider):
('prefix', forms.CharField( ('prefix', forms.CharField(
label=_('Prefix for the payment reference'), label=_('Prefix for the payment reference'),
required=False, required=False,
)) )),
('pending_description', I18nFormField(
label=_('Additional text to show on pending orders'),
help_text=_('This text will be shown on the order confirmation page for pending orders in addition to'
'the standard text.'),
widget=I18nTextarea,
required=False,
)),
]) ])
@property @property
@@ -216,6 +223,7 @@ class BankTransfer(BasePaymentProvider):
'order': payment.order, 'order': payment.order,
'amount': payment.amount, 'amount': payment.amount,
'settings': self.settings, 'settings': self.settings,
'pending_description': self.settings.get('pending_description', as_type=LazyI18nString),
'details': self.settings.get('bank_details', as_type=LazyI18nString), 'details': self.settings.get('bank_details', as_type=LazyI18nString),
} }
return template.render(ctx) return template.render(ctx)

View File

@@ -5,7 +5,11 @@
{% load ibanformat %} {% load ibanformat %}
{% load money %} {% load money %}
{% load unidecode %} {% load unidecode %}
{% load rich_text %}
{% if pending_description %}
{{ pending_description|rich_text }}
{% endif %}
<p>{% blocktrans trimmed %} <p>{% blocktrans trimmed %}
Please transfer the full amount to the following bank account: Please transfer the full amount to the following bank account:
{% endblocktrans %}</p> {% endblocktrans %}</p>