mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Render payment info on 'Confirm' page
This commit is contained in:
@@ -98,6 +98,13 @@ class BasePaymentProvider:
|
||||
ctx = Context({'request': request, 'form': form})
|
||||
return template.render(ctx)
|
||||
|
||||
def checkout_confirm_render(self, request) -> str:
|
||||
"""
|
||||
Returns the HTML that should be displayed when the user selected this provider
|
||||
on the 'confirm order' page.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def checkout_prepare(self, request, total) -> "bool|HttpResponse":
|
||||
"""
|
||||
Will be called if the user selects this provider as his payment method.
|
||||
|
||||
@@ -29,3 +29,9 @@ class BankTransfer(BasePaymentProvider):
|
||||
|
||||
def checkout_is_valid_session(self, request):
|
||||
return True
|
||||
|
||||
def checkout_confirm_render(self, request):
|
||||
form = self.checkout_form(request)
|
||||
template = get_template('pretixplugins/banktransfer/checkout_payment_confirm.html')
|
||||
ctx = Context({'request': request, 'form': form, 'settings': self.settings})
|
||||
return template.render(ctx)
|
||||
|
||||
@@ -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>
|
||||
@@ -252,6 +252,7 @@ class OrderConfirm(EventViewMixin, CartDisplayMixin, EventLoginRequiredMixin, Ch
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
ctx['cart'] = self.get_cart()
|
||||
ctx['payment'] = self.payment_provider.checkout_confirm_render(self.request)
|
||||
return ctx
|
||||
|
||||
@cached_property
|
||||
|
||||
Reference in New Issue
Block a user