add: add logs for callback api
This commit is contained in:
@@ -30,6 +30,7 @@ class AtmosCallbackApiView(APIView):
|
|||||||
# if client_ip not in settings.ALLOWED_ATMOS_IPS:
|
# if client_ip not in settings.ALLOWED_ATMOS_IPS:
|
||||||
# return Response({"status": 0, "message": "IP ruxsat etilmagan"}, status=403)
|
# return Response({"status": 0, "message": "IP ruxsat etilmagan"}, status=403)
|
||||||
data = request.data
|
data = request.data
|
||||||
|
print(data)
|
||||||
if not data:
|
if not data:
|
||||||
return Response(
|
return Response(
|
||||||
{'success': 0, "message": "Request body required"},
|
{'success': 0, "message": "Request body required"},
|
||||||
@@ -44,7 +45,7 @@ class AtmosCallbackApiView(APIView):
|
|||||||
|
|
||||||
check_string = f"{store_id}{transaction_id}{invoice}{amount}{settings.API_KEY}"
|
check_string = f"{store_id}{transaction_id}{invoice}{amount}{settings.API_KEY}"
|
||||||
generated_sign = hashlib.sha256(check_string.encode()).hexdigest()
|
generated_sign = hashlib.sha256(check_string.encode()).hexdigest()
|
||||||
|
print(generated_sign, '----------------------------------------------------')
|
||||||
if generated_sign != sign:
|
if generated_sign != sign:
|
||||||
return Response(
|
return Response(
|
||||||
{"status": 0, "message": f"Инвойс с номером {invoice} отсутствует в системе"},
|
{"status": 0, "message": f"Инвойс с номером {invoice} отсутствует в системе"},
|
||||||
|
|||||||
Reference in New Issue
Block a user