From 020ca8a79a684bf872b7faad5cce314dc14ebf64 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 6 Mar 2018 12:46:50 +0300 Subject: [PATCH] Yandex_update --- finance/views.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/finance/views.py b/finance/views.py index 684b2f1..8bd89e3 100644 --- a/finance/views.py +++ b/finance/views.py @@ -242,16 +242,17 @@ class YandexCheckView(APIView): # TODO Нужно решение # pay.invoice_id = int(data['invoiceId']) # pay.save() - xml_res = dicttoxml.dicttoxml({ + res = { 'code': 0, 'shopId': int(pay.shop_id), 'invoiceId': int(data['invoiceId']), 'orderSumAmount': pay.order_amount, 'performedDatetime': datetime.datetime.now(), - }) - logger_yandex.info(xml_res) + } - return HttpResponse(xml_res, content_type='application/xml') + logger_yandex.info(res) + + return Response(res, status=200) class YandexAvisoView(APIView): @@ -277,16 +278,16 @@ class YandexAvisoView(APIView): pay.status = Payment.STATUS.SUCCESS pay.save() - xml_res = dicttoxml.dicttoxml({ + res = { 'code': 0, - 'shopId':int(pay.shop_id), + 'shopId': int(pay.shop_id), 'invoiceId': int(data['invoiceId']), 'orderSumAmount': pay.order_amount, 'performedDatetime': datetime.datetime.now(), - }) - logger_yandex.info(xml_res) + } + logger_yandex.info(res) - return HttpResponse(xml_res, content_type='application/xml') + return Response(res, status=200) class YandexFailView(APIView):