Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1 from All-Turtles/notifications
Browse files Browse the repository at this point in the history
Server to server notification changes
  • Loading branch information
sethhitch authored Nov 6, 2020
2 parents 53440c0 + 26357d5 commit c4e5ed5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion appstore/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ type NotificationType string
const (
// Initial purchase of the subscription.
NotificationTypeInitialBuy NotificationType = "INITIAL_BUY"
// A customer’s subscription has successfully auto-renewed.
NotificationTypeDidRenew NotificationType = "DID_RENEW"
// Subscription was canceled by Apple customer support.
NotificationTypeCancel NotificationType = "CANCEL"
// Automatic renewal was successful for an expired subscription.
Expand All @@ -21,6 +23,8 @@ const (
NotificationTypeDidChangeRenewalStatus NotificationType = "DID_CHANGE_RENEWAL_STATUS"
// Subscription failed to renew due to a billing issue.
NotificationTypeDidFailToRenew NotificationType = "DID_FAIL_TO_RENEW"
// App Store successfully refunded a transaction.
NotificationTypeRefund NotificationType = "REFUND"
)

type NotificationEnvironment string
Expand Down Expand Up @@ -81,7 +85,7 @@ type SubscriptionNotification struct {

// This is the same as the Subscription Expiration Intent in the receipt.
// Posted only if notification_type is RENEWAL or INTERACTIVE_RENEWAL.
ExpirationIntent string `json:"expiration_intent"`
ExpirationIntent int `json:"expiration_intent"`

// Auto renew info
AutoRenewStatus string `json:"auto_renew_status"` // false or true
Expand All @@ -98,6 +102,12 @@ type SubscriptionNotification struct {
// In the new notifications above properties latest_receipt, latest_receipt_info are moved under this one
UnifiedReceipt NotificationUnifiedReceipt `json:"unified_receipt"`

// A string that contains the app bundle ID.
BID string `json:"bid"`

// A string that contains the app bundle version.
BVRS string `json:"bvrs"`

// Posted only if the notification_type is RENEWAL or CANCEL or if renewal failed and subscription expired.
// Deprecated: see details: https://developer.apple.com/documentation/appstoreservernotifications/ .
LatestExpiredReceipt string `json:"latest_expired_receipt"`
Expand Down

0 comments on commit c4e5ed5

Please sign in to comment.