more work on payments

This commit is contained in:
Thomas Steen Rasmussen 2016-05-16 19:31:14 +02:00
parent ce98d97d74
commit 1fb5454590
3 changed files with 45 additions and 2 deletions

View file

@ -0,0 +1,15 @@
{% extends 'base.html' %}
{% load bootstrap3 %}
{% block content %}
<h2>Pay by Bank Transfer</h2>
<p class="lead">
IBAN: DKnoget
Swift: nogetandet
</p>
<p>Note: It might take several days before we register your bank transfer, especially if you are outside of SEPA region.</p>
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends 'base.html' %}
{% load bootstrap3 %}
{% block content %}
<h2>Thank you for your payment!</h2>
<p class="lead">
{% if order.paid %}
Thank you for your payment. Your order has been marked as paid.
{% else %}
Thank you for your payment. Your order will be marked as paid as soon as we register a callback from our payment provider.</p>
{% endif %}
</p>
{% endblock %}

View file

@ -316,6 +316,21 @@ class EpayCallbackView(View):
return HttpResponse('OK') return HttpResponse('OK')
class BankTransferView(TemplateView): class EpayThanksView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, DetailView):
template_name = 'epay_form.html' model = Order
template_name = 'epay_thanks.html'
def dispatch(self, request, *args, **kwargs):
if order.open:
### this order is open, what is the user doing here?
return HttpResponseRedirect(reverse_lazy('shop:order_detail', kwargs={'pk': order.pk}))
return super(EpayThanksView, self).dispatch(
request, *args, **kwargs
)
class BankTransferView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, DetailView):
model = Order
template_name = 'bank_transfer.html'