Merge branch 'yandex_pay_fix' into 'dev'

Yandex_update

See merge request !190
feature/fix_accout_not_found
Andrey 8 years ago
commit 368b715125
  1. 19
      finance/views.py

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

Loading…
Cancel
Save