fix saving of coinify callbacks

This commit is contained in:
Thomas Steen Rasmussen 2016-05-29 19:53:56 +02:00
parent eb04ee94b4
commit ff94193fcc

View file

@ -401,8 +401,8 @@ class CoinifyCallbackView(SingleObjectMixin, View):
# save callback to db # save callback to db
callbackobject = CoinifyAPICallback.objects.create( callbackobject = CoinifyAPICallback.objects.create(
headers=json.dumps(headerdict), headers=headerdict,
payload=request.body, payload=json.loads(request.body),
order=self.get_object() order=self.get_object()
) )
if sdk.validate_callback(request.body, signature): if sdk.validate_callback(request.body, signature):
@ -432,7 +432,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
else: else:
return HttpResponseBadRequest('unsupported event') return HttpResponseBadRequest('unsupported event')
else: else:
print "invalid callback detected" print "invalid coinify callback detected"
return HttpResponseBadRequest('something is fucky') return HttpResponseBadRequest('something is fucky')