add more logs

This commit is contained in:
2025-12-19 14:54:46 +02:00
parent 524fe754c6
commit de2cf6988d

View File

@@ -1,4 +1,5 @@
from __future__ import annotations from __future__ import annotations
import jwt
import os import os
import logging import logging
@@ -41,6 +42,13 @@ def ipn():
try: try:
# Pass the whole request object, not just request.data # Pass the whole request object, not just request.data
data = verify_ipn(request) data = verify_ipn(request)
sig_header = request.headers.get('X-Netopia-Signature')
if sig_header:
# This doesn't verify, it just PEERS inside the message to see the POS Signature
unverified_payload = jwt.decode(sig_header, options={"verify_signature": False})
app.logger.info(f"JWT PAYLOAD POS: {unverified_payload.get('posSignature')}")
app.logger.info("IPN OK: %s", data) app.logger.info("IPN OK: %s", data)
return jsonify({"errorCode": 0}), 200 return jsonify({"errorCode": 0}), 200
except Exception as e: except Exception as e: