-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support App Store Server Notifications v2.10
- Loading branch information
Showing
8 changed files
with
193 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"notificationType": "EXTERNAL_PURCHASE_TOKEN", | ||
"subtype": "UNREPORTED", | ||
"notificationUUID": "002e14d5-51f5-4503-b5a8-c3a1af68eb20", | ||
"version": "2.0", | ||
"signedDate": 1698148900000, | ||
"externalPurchaseToken": { | ||
"externalPurchaseId": "b2158121-7af9-49d4-9561-1f588205523e", | ||
"tokenCreationDate": 1698148950000, | ||
"appAppleId": 55555, | ||
"bundleId": "com.example" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
assets/signedExternalPurchaseTokenSandboxNotification.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"notificationType": "EXTERNAL_PURCHASE_TOKEN", | ||
"subtype": "UNREPORTED", | ||
"notificationUUID": "002e14d5-51f5-4503-b5a8-c3a1af68eb20", | ||
"version": "2.0", | ||
"signedDate": 1698148900000, | ||
"externalPurchaseToken": { | ||
"externalPurchaseId": "SANDBOX_b2158121-7af9-49d4-9561-1f588205523e", | ||
"tokenCreationDate": 1698148950000, | ||
"appAppleId": 55555, | ||
"bundleId": "com.example" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use chrono::{DateTime, Utc}; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_with::formats::Flexible; | ||
use serde_with::TimestampMilliSeconds; | ||
|
||
/// The payload data that contains an external purchase token. | ||
/// | ||
/// [externalPurchaseToken](https://developer.apple.com/documentation/appstoreservernotifications/externalpurchasetoken) | ||
#[serde_with::serde_as] | ||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] | ||
pub struct ExternalPurchaseToken { | ||
/// The field of an external purchase token that uniquely identifies the token. | ||
/// | ||
/// [externalPurchaseId](https://developer.apple.com/documentation/appstoreservernotifications/externalpurchaseid) | ||
#[serde(rename = "externalPurchaseId")] | ||
pub external_purchase_id: Option<String>, | ||
|
||
/// The field of an external purchase token that contains the UNIX date, in milliseconds, | ||
/// when the system created the token. | ||
/// | ||
/// [tokenCreationDate](https://developer.apple.com/documentation/appstoreservernotifications/tokencreationdate) | ||
#[serde(rename = "tokenCreationDate")] | ||
#[serde_as(as = "Option<TimestampMilliSeconds<String, Flexible>>")] | ||
pub token_creation_date: Option<DateTime<Utc>>, | ||
|
||
/// The unique identifier of an app in the App Store. | ||
/// | ||
/// [appAppleId](https://developer.apple.com/documentation/appstoreservernotifications/appappleid) | ||
#[serde(rename = "appAppleId")] | ||
pub app_apple_id: Option<i64>, | ||
|
||
/// The bundle identifier of an app. | ||
/// | ||
/// [bundleId](https://developer.apple.com/documentation/appstoreservernotifications/bundleid) | ||
#[serde(rename = "bundleId")] | ||
pub bundle_id: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,6 @@ pub enum Subtype { | |
Summary, | ||
#[serde(rename = "FAILURE")] | ||
Failure, | ||
#[serde(rename = "UNREPORTED")] | ||
Unreported, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters