From 427e9e686093ac9b3a9d7fb11fac9f2b0a223194 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 16 Jan 2024 10:14:28 +0100 Subject: [PATCH] test --- subscriptions/views.py | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/subscriptions/views.py b/subscriptions/views.py index dfcbfa2..e5dad7c 100644 --- a/subscriptions/views.py +++ b/subscriptions/views.py @@ -29,27 +29,17 @@ def app_store_webhook(request): #fulljson = json.loads(data) # signedPayload = fulljson['signedPayload'] - decoded_payload = json.loads(base64.b64decode(decoded)) + try: + data = asn2.parse(decoded) + type = data['notificationType'] - # Now you can access the decoded data - type = decoded_payload.get('notification_type') - notification = ASSNotification( - content=type, - ) - notification.save() + notification = ASSNotification( + content=type, + ) + notification.save() - - # try: - # data = asn2.parse(request.body) - # type = data['notificationType'] - # - # notification = ASSNotification( - # content=type, - # ) - # notification.save() - # - # except InvalidTokenError: - # pass + except InvalidTokenError: + pass # KEY_FILE = settings.ASS_KEY_FILE #