|
|
|
|
@ -242,17 +242,16 @@ class YandexCheckView(APIView): |
|
|
|
|
# TODO Нужно решение |
|
|
|
|
# pay.invoice_id = int(data['invoiceId']) |
|
|
|
|
# pay.save() |
|
|
|
|
res = { |
|
|
|
|
xml_res = dicttoxml.dicttoxml({ |
|
|
|
|
'code': 0, |
|
|
|
|
'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 Response(res, status=200) |
|
|
|
|
return Response(xml_res, content_type='application/xml') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YandexAvisoView(APIView): |
|
|
|
|
@ -278,16 +277,16 @@ class YandexAvisoView(APIView): |
|
|
|
|
pay.status = Payment.STATUS.SUCCESS |
|
|
|
|
pay.save() |
|
|
|
|
|
|
|
|
|
res = { |
|
|
|
|
xml_res = dicttoxml.dicttoxml({ |
|
|
|
|
'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(res) |
|
|
|
|
}) |
|
|
|
|
logger_yandex.info(xml_res) |
|
|
|
|
|
|
|
|
|
return Response(res, status=200) |
|
|
|
|
return HttpResponse(xml_res, content_type='application/xml') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YandexFailView(APIView): |
|
|
|
|
|