From 25b98cdc2c91b9800f642661999d43f0bc64ea20 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 6 Mar 2018 13:39:15 +0300 Subject: [PATCH 1/2] Yandex_update --- finance/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finance/views.py b/finance/views.py index 7cb1e50..684b2f1 100644 --- a/finance/views.py +++ b/finance/views.py @@ -251,7 +251,7 @@ class YandexCheckView(APIView): }) logger_yandex.info(xml_res) - return Response(xml_res, content_type='application/xml') + return HttpResponse(xml_res, content_type='application/xml') class YandexAvisoView(APIView): From 8972d465edb2eb94927ac0b80650897972cbca73 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 6 Mar 2018 13:54:03 +0300 Subject: [PATCH 2/2] Yandex_update --- finance/views.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/finance/views.py b/finance/views.py index 684b2f1..6671172 100644 --- a/finance/views.py +++ b/finance/views.py @@ -242,13 +242,10 @@ class YandexCheckView(APIView): # TODO Нужно решение # pay.invoice_id = int(data['invoiceId']) # pay.save() - xml_res = dicttoxml.dicttoxml({ - 'code': 0, - 'shopId': int(pay.shop_id), - 'invoiceId': int(data['invoiceId']), - 'orderSumAmount': pay.order_amount, - 'performedDatetime': datetime.datetime.now(), - }) + + xml_res = """ + """ % (datetime.datetime.now(), str(data['invoiceId']), str(pay.shop_id), str(pay.order_amount)) + logger_yandex.info(xml_res) return HttpResponse(xml_res, content_type='application/xml') @@ -284,6 +281,10 @@ class YandexAvisoView(APIView): 'orderSumAmount': pay.order_amount, 'performedDatetime': datetime.datetime.now(), }) + + """ + """ % (datetime.datetime.now(), str(data['invoiceId']), str(pay.shop_id), str(pay.order_amount)) + logger_yandex.info(xml_res) return HttpResponse(xml_res, content_type='application/xml')