Laurent 2 years ago
parent 254745907c
commit ed115ea5e0
  1. 28
      subscriptions/views.py

@ -29,17 +29,27 @@ def app_store_webhook(request):
#fulljson = json.loads(data) #fulljson = json.loads(data)
# signedPayload = fulljson['signedPayload'] # signedPayload = fulljson['signedPayload']
try: decoded_payload = json.loads(base64.b64decode(data))
data = asn2.parse(request.body)
type = data['notificationType']
notification = ASSNotification( # Now you can access the decoded data
content=type, type = decoded_payload.get('notification_type')
) notification = ASSNotification(
notification.save() content=type,
)
notification.save()
except InvalidTokenError:
pass # try:
# data = asn2.parse(request.body)
# type = data['notificationType']
#
# notification = ASSNotification(
# content=type,
# )
# notification.save()
#
# except InvalidTokenError:
# pass
# KEY_FILE = settings.ASS_KEY_FILE # KEY_FILE = settings.ASS_KEY_FILE
# #

Loading…
Cancel
Save