app-store-notifications-v2-validator-0.0.5
توضیحات
AppStore notifications v2 Validator
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | app-store-notifications-v2-validator-0.0.5 |
| نام | app-store-notifications-v2-validator |
| نسخه کتابخانه | 0.0.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Rick Wierenga |
| ایمیل نویسنده | rick_wierenga@icloud.com |
| آدرس صفحه اصلی | https://github.com/rickwierenga/app-store-notifications-v2-validator |
| آدرس اینترنتی | https://pypi.org/project/app-store-notifications-v2-validator/ |
| مجوز | - |
# AppStore Notifications V2 Validator
Library to read and validate [App Store Server Notifications V2](https://developer.apple.com/documentation/appstoreservernotifications/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 put it in the directory where the code is run.
## Usage
```py
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
نیازمندی
| مقدار | نام |
|---|---|
| ==1.15.1 | cffi |
| ==39.0.1 | cryptography |
| ==2.21 | pycparser |
| ==2.3.0 | PyJWT |
| ==23.0.0 | pyOpenSSL |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl app-store-notifications-v2-validator-0.0.5:
pip install app-store-notifications-v2-validator-0.0.5.whl
نصب پکیج tar.gz app-store-notifications-v2-validator-0.0.5:
pip install app-store-notifications-v2-validator-0.0.5.tar.gz