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):