really fix coinify callback code
This commit is contained in:
parent
8a354afcca
commit
354384d12d
|
@ -464,14 +464,13 @@ class CoinifyCallbackView(SingleObjectMixin, View):
|
||||||
print "unable to find CoinifyAPIInvoice with id %s" % callbackjson['data']['id']
|
print "unable to find CoinifyAPIInvoice with id %s" % callbackjson['data']['id']
|
||||||
return HttpResponseBadRequest('bad coinifyinvoice id')
|
return HttpResponseBadRequest('bad coinifyinvoice id')
|
||||||
|
|
||||||
# save new invoice payload
|
# save new coinifyinvoice payload
|
||||||
invoice = coinifyinvoice.order.invoice
|
coinifyinvoice.invoicejson = callbackjson['data']
|
||||||
invoice.payload = callbackjson['data']
|
coinifyinvoice.save()
|
||||||
invoice.save()
|
|
||||||
|
|
||||||
# so, is the invoice paid in full now?
|
# so, is the order paid in full now?
|
||||||
if callbackjson['data']['state'] == 'complete':
|
if callbackjson['data']['state'] == 'complete':
|
||||||
invoice.order.mark_as_paid()
|
coinifyinvoice.order.mark_as_paid()
|
||||||
|
|
||||||
# return 200 OK
|
# return 200 OK
|
||||||
return HttpResponse('OK')
|
return HttpResponse('OK')
|
||||||
|
|
Loading…
Reference in a new issue