diff --git a/shop/models.py b/shop/models.py index e0856334..619ebda5 100644 --- a/shop/models.py +++ b/shop/models.py @@ -92,6 +92,12 @@ class Order(CreatedUpdatedModel): ) )['sum'] + def get_coinify_callback_url(self, request): + return 'https://' + request.get_host() + str(reverse_lazy('shop:coinify_callback', kwargs={'pk': self.pk})) + + def get_coinify_thanks_url(self, request): + return 'https://' + request.get_host() + str(reverse_lazy('shop:coinify_thanks', kwargs={'pk': self.pk})) + def get_epay_accept_url(self, request): return 'https://' + request.get_host() + str(reverse_lazy('shop:epay_thanks', kwargs={'pk': self.pk})) diff --git a/shop/templates/order_detail.html b/shop/templates/order_detail.html index 5bca6512..bef2d75b 100644 --- a/shop/templates/order_detail.html +++ b/shop/templates/order_detail.html @@ -70,13 +70,23 @@ {% bootstrap_button "Update order" button_type="submit" button_class="btn-primary" name="update_order" %}
-

Checkout

+

Payment options

+{% if not order.paid %} +

Your order is currently unpaid. Please pick a payment option below.

+

If you have already paid but your order is still showing unpaid, +you can email us or use the +contact page for other options. +Please allow for up to a week for bank transfers to be registered, +the other payment methods should be more or less instant.

{% csrf_token %} {% bootstrap_button " Credit card" button_type="submit" button_class="btn-primary" name="payment_method" value="credit_card" %} {% bootstrap_button " Blockchain" button_type="submit" button_class="btn-primary" name="payment_method" value="blockchain" %} {% bootstrap_button " Bank transfer" button_type="submit" button_class="btn-primary" name="payment_method" value="bank_transfer" %}
+{% else %} +

Your order is paid in full.

+{% endif %} {% endif %} {% endblock %} diff --git a/shop/views.py b/shop/views.py index f99b9841..47439786 100644 --- a/shop/views.py +++ b/shop/views.py @@ -337,14 +337,8 @@ class CoinifyRedirectView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureUn plugin_name='BornHack 2016 webshop', plugin_version='1.0', description='BornHack 2016 order id #%s' % order.id, - callback_url=reverse( - 'shop:coinify_callback', - kwargs={'pk': order.id} - ), - return_url=reverse( - 'shop:coinify_thanks', - kwargs={'pk': order.id} - ), + callback_url=order.get_coinify_callback_url, + return_url=order.get_coinify_thanks_url, ) # Parse response