|
|
|
@ -487,6 +487,7 @@ class DemoYandexCheckView(APIView): |
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def post(request): |
|
|
|
def post(request): |
|
|
|
# Деалем допущение, что customerNumber=abc1111111 иначе всё плохо |
|
|
|
# Деалем допущение, что customerNumber=abc1111111 иначе всё плохо |
|
|
|
|
|
|
|
logger_yandex.info('Начало тестирования checkYandex') |
|
|
|
data = dict() |
|
|
|
data = dict() |
|
|
|
try: |
|
|
|
try: |
|
|
|
for i in request.body.decode('utf-8').split('&'): |
|
|
|
for i in request.body.decode('utf-8').split('&'): |
|
|
|
@ -494,9 +495,8 @@ class DemoYandexCheckView(APIView): |
|
|
|
val = i.split('=')[1] |
|
|
|
val = i.split('=')[1] |
|
|
|
data[key] = val |
|
|
|
data[key] = val |
|
|
|
|
|
|
|
|
|
|
|
logger_yandex.info('Начало тестирования checkYandex') |
|
|
|
|
|
|
|
except IndexError: |
|
|
|
except IndexError: |
|
|
|
logger_yandex.error("Не предвиденная ошибка проверки тестогого платежа") |
|
|
|
logger_yandex.error("Непредвиденная ошибка проверки тестогого платежа") |
|
|
|
return Response(status=204) |
|
|
|
return Response(status=204) |
|
|
|
|
|
|
|
|
|
|
|
now = timezone.now() |
|
|
|
now = timezone.now() |
|
|
|
@ -514,9 +514,7 @@ class DemoYandexCheckView(APIView): |
|
|
|
) |
|
|
|
) |
|
|
|
return HttpResponse(xml_res, content_type='application/xml') |
|
|
|
return HttpResponse(xml_res, content_type='application/xml') |
|
|
|
except KeyError: |
|
|
|
except KeyError: |
|
|
|
logger_yandex.error('Начало тестирования checkYandex', exc_info=True, extra={ |
|
|
|
logger_yandex.error('Ошибка в данных checkYandex') |
|
|
|
'data': data, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return Response(status=204) |
|
|
|
return Response(status=204) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -524,13 +522,13 @@ class DemoYandexAvisoView(APIView): |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def post(request): |
|
|
|
def post(request): |
|
|
|
|
|
|
|
logger_yandex.info('Начало тестирования avisoYandex') |
|
|
|
data = dict() |
|
|
|
data = dict() |
|
|
|
for i in request.body.decode('utf-8').split('&'): |
|
|
|
for i in request.body.decode('utf-8').split('&'): |
|
|
|
key = i.split('=')[0] |
|
|
|
key = i.split('=')[0] |
|
|
|
val = i.split('=')[1] |
|
|
|
val = i.split('=')[1] |
|
|
|
data[key] = val |
|
|
|
data[key] = val |
|
|
|
|
|
|
|
|
|
|
|
logger_yandex.info('Начало тестирования avisoYandex') |
|
|
|
|
|
|
|
now = timezone.now() |
|
|
|
now = timezone.now() |
|
|
|
if float(data['orderSumAmount']) < 1001: |
|
|
|
if float(data['orderSumAmount']) < 1001: |
|
|
|
xml_res = """<paymentAvisoResponse performedDatetime="%s" code="0" invoiceId="%s" shopId="%s"/> |
|
|
|
xml_res = """<paymentAvisoResponse performedDatetime="%s" code="0" invoiceId="%s" shopId="%s"/> |
|
|
|
|