json.loads wants strings
This commit is contained in:
parent
3f69d8521e
commit
c90837a8f0
|
@ -604,7 +604,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
|
||||||
# save callback to db
|
# save callback to db
|
||||||
callbackobject = CoinifyAPICallback.objects.create(
|
callbackobject = CoinifyAPICallback.objects.create(
|
||||||
headers=headerdict,
|
headers=headerdict,
|
||||||
payload=json.loads(request.body),
|
payload=json.loads(str(request.body)),
|
||||||
order=self.get_object()
|
order=self.get_object()
|
||||||
)
|
)
|
||||||
if sdk.validate_callback(request.body, signature):
|
if sdk.validate_callback(request.body, signature):
|
||||||
|
@ -613,7 +613,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
|
||||||
callbackobject.save()
|
callbackobject.save()
|
||||||
|
|
||||||
# parse json
|
# parse json
|
||||||
callbackjson = json.loads(request.body)
|
callbackjson = json.loads(str(request.body))
|
||||||
if callbackjson['event'] == 'invoice_state_change' or callbackjson['event'] == 'invoice_manual_resend':
|
if callbackjson['event'] == 'invoice_state_change' or callbackjson['event'] == 'invoice_manual_resend':
|
||||||
# find coinify invoice in db
|
# find coinify invoice in db
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue