From f1222274186460af0195ccc8f84cde1b805fbbb6 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 6 Mar 2018 08:31:22 +0300 Subject: [PATCH] Yandex_update --- finance/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/finance/views.py b/finance/views.py index d569ffc..684b2f1 100644 --- a/finance/views.py +++ b/finance/views.py @@ -244,14 +244,14 @@ class YandexCheckView(APIView): # pay.save() xml_res = dicttoxml.dicttoxml({ 'code': 0, - 'shopId': pay.shop_id, - 'invoiceId': data['invoiceId'], + 'shopId': int(pay.shop_id), + 'invoiceId': int(data['invoiceId']), 'orderSumAmount': pay.order_amount, 'performedDatetime': datetime.datetime.now(), }) logger_yandex.info(xml_res) - return Response(xml_res, status=200) + return HttpResponse(xml_res, content_type='application/xml') class YandexAvisoView(APIView): @@ -279,14 +279,14 @@ class YandexAvisoView(APIView): xml_res = dicttoxml.dicttoxml({ 'code': 0, - 'shopId': pay.shop_id, - 'invoiceId': data['invoiceId'], + 'shopId':int(pay.shop_id), + 'invoiceId': int(data['invoiceId']), 'orderSumAmount': pay.order_amount, 'performedDatetime': datetime.datetime.now(), }) logger_yandex.info(xml_res) - return Response(xml_res, status=200) + return HttpResponse(xml_res, content_type='application/xml') class YandexFailView(APIView):