Skip to main content

AppStore notifications v2 Validator

Project description

AppStore Notifications V2 Validator

downloads per month

Library to read and validate App Store Server Notifications V2 in Python.

pip install app-store-notifications-v2-validator

Download "Apple Root CA - G3 Root" from https://www.apple.com/certificateauthority/. Store the file path in an environment variable named APPLE_ROOT_CA or pass file path as apple_root_cert_path param in asn2.parse or put it in the directory where the code is run.

Usage

import app_store_notifications_v2_validator as asn2
request_body = b'{"signedPayload":"eyJh .... "}'
try:
	data = asn2.parse(request_body)
except InvalidTokenError:
	pass

data is a dictionary:

{
  "notificationType": "SUBSCRIBED",
  "subtype": "RESUBSCRIBE",
  "notificationUUID": "00000000-0000-0000-0000-000000000000",
  "data": {
    "bundleId": "com.example.App",
    "bundleVersion": "1",
    "environment": "Sandbox",
    "signedTransactionInfo": {
      "transactionId": "0000000000000000",
      "originalTransactionId": "0000000000000000",
      "webOrderLineItemId": "0000000000000000",
      "bundleId": "com.example.App",
      "productId": "com.example.App.pro",
      "subscriptionGroupIdentifier": "00000000",
      "purchaseDate": 0000000000000,
      "originalPurchaseDate": 0000000000000,
      "expiresDate": 0000000000000,
      "quantity": 1,
      "type": "Auto-Renewable Subscription",
      "inAppOwnershipType": "PURCHASED",
      "signedDate": 000000000000
    },
    "signedRenewalInfo": {
      "originalTransactionId": "0000000000000000",
      "autoRenewProductId": "com.example.App.pro",
      "productId": "com.example.App.pro",
      "autoRenewStatus": 1,
      "signedDate": 0000000000000
    }
  },
  "version": "2.0"
}

© 2022-2023 Rick Wierenga

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file app-store-notifications-v2-validator-0.0.9.tar.gz.

File metadata

File hashes

Hashes for app-store-notifications-v2-validator-0.0.9.tar.gz
Algorithm Hash digest
SHA256 d8f2c87e20eee80804c850270c95c10eba92f28d7a7e2c538e3578fcea47227f
MD5 3b2e93d5c06cf016552af86655ddd0d1
BLAKE2b-256 1cb52e3a47a6c25527e18715f0158d7bb33b7bae7d9e08f426d4e1a19ce53f9b

See more details on using hashes here.

File details

Details for the file app_store_notifications_v2_validator-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for app_store_notifications_v2_validator-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 30b9a4ceb2c9e7bec6aa7343b72833ecc192ed2e4e3477e012f90f53889a8a35
MD5 0558d780d00bbf306f6272def4c5c733
BLAKE2b-256 f0e73970d230f6859d46d22653d14ea273e6196bfe56432d344792b9054d0bc6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page