Allow payment providers to define custom form fields / templates

This commit is contained in:
Raphael Michel
2015-03-06 22:20:04 +01:00
parent 29cedbaac3
commit e630858a35
8 changed files with 70 additions and 1 deletions

View File

@@ -1,4 +1,6 @@
from collections import OrderedDict
from django.template import Context
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
from django import forms
@@ -16,3 +18,8 @@ class BankTransfer(BasePaymentProvider):
required=False
))
])
def checkout_form_render(self, request) -> str:
template = get_template('pretixplugins/banktransfer/checkout_payment_form.html')
ctx = Context({'request': request, 'event': self.event, 'settings': self.settings})
return template.render(ctx)

View File

@@ -0,0 +1,10 @@
{% load i18n %}
<p>{% blocktrans trimmed %}
After completing your purchase, we will ask you to transfer the money to the following
bank account, using a personal reference code.
{% endblocktrans %}</p>
<address>
{{ settings.bank_details|linebreaksbr }}
</address>