Skip to content

Commit ff947a7

Browse files
authored
Merge pull request #136 from takecy/master
Add some field in responsebody
2 parents 9012e15 + 99aab02 commit ff947a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

appstore/notification.go

+12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package appstore
22

3+
// NotificationType is type
4+
// https://developer.apple.com/documentation/appstoreservernotifications/notification_type
35
// https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW16
46
type NotificationType string
57

8+
// list of NotificationType
69
const (
710
// Initial purchase of the subscription.
811
NotificationTypeInitialBuy NotificationType = "INITIAL_BUY"
@@ -29,8 +32,10 @@ const (
2932
NotificationTypeDidRenew NotificationType = "DID_RENEW"
3033
)
3134

35+
// NotificationEnvironment is type
3236
type NotificationEnvironment string
3337

38+
// list of NotificationEnvironment
3439
const (
3540
NotificationSandbox NotificationEnvironment = "Sandbox"
3641
NotificationProduction NotificationEnvironment = "PROD"
@@ -72,6 +77,8 @@ type NotificationUnifiedReceipt struct {
7277
PendingRenewalInfo []PendingRenewalInfo `json:"pending_renewal_info,omitempty"`
7378
}
7479

80+
// SubscriptionNotification is struct for
81+
// https://developer.apple.com/documentation/appstoreservernotifications/responsebody
7582
type SubscriptionNotification struct {
7683
Environment NotificationEnvironment `json:"environment"`
7784
NotificationType NotificationType `json:"notification_type"`
@@ -110,6 +117,11 @@ type SubscriptionNotification struct {
110117
// Deprecated: see details: https://developer.apple.com/documentation/appstoreservernotifications/ .
111118
LatestExpiredReceiptInfo NotificationReceipt `json:"latest_expired_receipt_info"`
112119

120+
// BID is the app bundle ID
121+
BID string `json:"bid,omitempty"`
122+
// BVRS is the app bundle version
123+
BVRS string `json:"bvrs,omitempty"`
124+
113125
// Posted only if the notification_type is CANCEL.
114126
CancellationDate
115127
}

0 commit comments

Comments
 (0)