main
Laurent 2 years ago
parent c1541a79ca
commit 41273537b8
  1. 5
      subscriptions/views.py
  2. 2
      token_generator.py

@ -15,10 +15,11 @@ def app_store_webhook(request):
data = request.body.decode('utf-8')
# Parse the JSON payload
payload = json.loads(data)
fulljson = json.loads(data)
signedPayload = fulljson['signedPayload']
notification = ASSNotification(
content=payload,
content=signedPayload,
)
notification.save()

@ -43,7 +43,7 @@ key=key
with open('jwt_signed.txt', 'w') as output:
output.write(client_secret)
curl -X POST -v -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IkpaQzlMNzZURFQiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiI2OWE2ZGU4My0wMmYyLTQ3ZTMtZTA1My01YjhjN2MxMWE0ZDEiLCJpYXQiOjE3MDUzMjIxMjUsImV4cCI6MTcwNTMyNTQyNSwiYXVkIjoiYXBwc3RvcmVjb25uZWN0LXYxIiwiYmlkIjoic3RheC5TbGFzaFBva2VyLm5vc2VibGVlZCJ9.dM2cM92BX7f4f8fuF72HRaOutK1POs6tQcVriXMQQIA_tA_HOayXYuTRt_cUc4HLqErkRj9NNiT0CV0ZJECqpQ' https://api.storekit-sandbox.itunes.apple.com/inApps/v1/notifications/test
# Usage, after run this code by python3
# get token from `client_secret.txt` and replace to [signed token]
# Remember expired time maximum is 20 minutes

Loading…
Cancel
Save