pass request to create_coinify_invoice()

This commit is contained in:
Thomas Steen Rasmussen 2017-06-19 23:52:01 +02:00
parent 45a5f58ddf
commit 3010033b75
2 changed files with 2 additions and 2 deletions

View file

@ -125,7 +125,7 @@ def get_coinify_invoice(coinify_invoiceid, order):
return coinifyinvoice
def create_coinify_invoice(order):
def create_coinify_invoice(order, request):
# put args for API request together
invoicedict = {
'amount': float(order.total),

View file

@ -545,7 +545,7 @@ class CoinifyRedirectView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureUn
# create a new coinify invoice if needed
if not hasattr(order, 'coinifyapiinvoice'):
coinifyinvoice = create_coinify_invoice(order)
coinifyinvoice = create_coinify_invoice(order, request)
if not coinifyinvoice:
messages.error(request, "There was a problem with the payment provider. Please try again later")
return HttpResponseRedirect(reverse_lazy('shop:order_detail', kwargs={'pk': self.get_object().pk}))