From 354384d12d902bc15e83295b63f73ea797d3cc95 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 31 May 2016 21:48:21 +0200 Subject: [PATCH] really fix coinify callback code --- shop/views.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/shop/views.py b/shop/views.py index 12cbe986..6cc9d568 100644 --- a/shop/views.py +++ b/shop/views.py @@ -464,14 +464,13 @@ class CoinifyCallbackView(SingleObjectMixin, View): print "unable to find CoinifyAPIInvoice with id %s" % callbackjson['data']['id'] return HttpResponseBadRequest('bad coinifyinvoice id') - # save new invoice payload - invoice = coinifyinvoice.order.invoice - invoice.payload = callbackjson['data'] - invoice.save() + # save new coinifyinvoice payload + coinifyinvoice.invoicejson = callbackjson['data'] + coinifyinvoice.save() - # so, is the invoice paid in full now? + # so, is the order paid in full now? if callbackjson['data']['state'] == 'complete': - invoice.order.mark_as_paid() + coinifyinvoice.order.mark_as_paid() # return 200 OK return HttpResponse('OK')