From 429683f4443da1cc354cee0a0f2716f14f581850 Mon Sep 17 00:00:00 2001 From: Son Date: Sat, 6 Nov 2021 18:25:15 +0100 Subject: [PATCH] log more data in apple.verify_receipt() --- app/api/views/apple.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/api/views/apple.py b/app/api/views/apple.py index a8e6c589..78b1f2b3 100644 --- a/app/api/views/apple.py +++ b/app/api/views/apple.py @@ -36,8 +36,8 @@ def apple_process_payment(): 200 of the payment is successful, i.e. user is upgraded to premium """ - LOG.d("request for /apple/process_payment") user = g.user + LOG.d("request for /apple/process_payment from %s", user) data = request.get_json() receipt_data = data.get("receipt_data") is_macapp = "is_macapp" in data @@ -291,9 +291,10 @@ def apple_update_notification(): def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]: - """Call verifyReceipt endpoint and create/update AppleSubscription table + """ + Call https://buy.itunes.apple.com/verifyReceipt and create/update AppleSubscription table Call the production URL for verifyReceipt first, - and proceed to verify with the sandbox URL if receive a 21007 status code. + use sandbox URL if receive a 21007 status code. Return AppleSubscription object if success @@ -473,8 +474,9 @@ def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]: if data["status"] != 0: LOG.w( - "verifyReceipt status !=0, probably invalid receipt. User %s", + "verifyReceipt status !=0, probably invalid receipt. User %s, data %s", user, + data, ) return None