|
9 | 9 | // Subscription was canceled by Apple customer support.
|
10 | 10 | NotificationTypeCancel NotificationType = "CANCEL"
|
11 | 11 | // Automatic renewal was successful for an expired subscription.
|
| 12 | + // Deprecated: DID_RECOVER should be used instead of RENEWAL |
12 | 13 | NotificationTypeRenewal NotificationType = "RENEWAL"
|
| 14 | + // Expired subscription recovered through a billing retry. |
| 15 | + NotificationTypeDidRecover NotificationType = "DID_RECOVER" |
13 | 16 | // Customer renewed a subscription interactively after it lapsed.
|
14 | 17 | NotificationTypeInteractiveRenewal NotificationType = "INTERACTIVE_RENEWAL"
|
15 | 18 | // Customer changed the plan that takes affect at the next subscription renewal. Current active plan is not affected.
|
@@ -53,6 +56,14 @@ type NotificationReceipt struct {
|
53 | 56 | CancellationDate
|
54 | 57 | }
|
55 | 58 |
|
| 59 | +type NotificationUnifiedReceipt struct { |
| 60 | + Status string `json:"status"` |
| 61 | + Environment Environment `json:"environment"` |
| 62 | + LatestReceipt string `json:"latest_receipt"` |
| 63 | + LatestReceiptInfo []InApp `json:"latest_receipt_info"` |
| 64 | + PendingRenewalInfo []PendingRenewalInfo `json:"pending_renewal_info,omitempty"` |
| 65 | +} |
| 66 | + |
56 | 67 | type SubscriptionNotification struct {
|
57 | 68 | Environment NotificationEnvironment `json:"environment"`
|
58 | 69 | NotificationType NotificationType `json:"notification_type"`
|
@@ -80,6 +91,9 @@ type SubscriptionNotification struct {
|
80 | 91 | LatestReceipt string `json:"latest_receipt"`
|
81 | 92 | LatestReceiptInfo NotificationReceipt `json:"latest_receipt_info"`
|
82 | 93 |
|
| 94 | + // In the new notifications above properties latest_receipt, latest_receipt_info are moved under this one |
| 95 | + UnifiedReceipt NotificationUnifiedReceipt `json:"unified_receipt"` |
| 96 | + |
83 | 97 | // Posted only if the notification_type is RENEWAL or CANCEL or if renewal failed and subscription expired.
|
84 | 98 | LatestExpiredReceipt string `json:"latest_expired_receipt"`
|
85 | 99 | LatestExpiredReceiptInfo NotificationReceipt `json:"latest_expired_receipt_info"`
|
|
0 commit comments