@@ -70,7 +70,34 @@ type MassExtendRenewalDateRequest struct {
7070 StorefrontCountryCodes []string `json:"storefrontCountryCodes"`
7171}
7272
73+ type DeliveryStatus string
74+
75+ // DeliveryStatus https://developer.apple.com/documentation/appstoreserverapi/deliverystatus
76+ const (
77+ DELIVERED DeliveryStatus = "DELIVERED"
78+ UNDELIVERED_QUALITY_ISSUE DeliveryStatus = "UNDELIVERED_QUALITY_ISSUE"
79+ UNDELIVERED_WRONG_ITEM DeliveryStatus = "UNDELIVERED_WRONG_ITEM"
80+ UNDELIVERED_SERVER_OUTAGE DeliveryStatus = "UNDELIVERED_SERVER_OUTAGE"
81+ UNDELIVERED_OTHER DeliveryStatus = "UNDELIVERED_OTHER"
82+ )
83+
84+ type RefundPreference string
85+
86+ // RefundPreference https://developer.apple.com/documentation/appstoreserverapi/refundpreference
87+ const (
88+ DECLINE RefundPreference = "DECLINE"
89+ GRANT_FULL RefundPreference = "GRANT_FULL"
90+ GRANT_PRORATED RefundPreference = "GRANT_PRORATED"
91+ )
92+
7393// ConsumptionRequestBody https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest
94+ type ConsumptionRequest struct {
95+ CustomerConsented bool `json:"customerConsented"`
96+ ConsumptionPercentage int32 `json:"consumptionPercentage"`
97+ DeliveryStatus DeliveryStatus `json:"deliveryStatus"`
98+ RefundPreference RefundPreference `json:"refundPreference"`
99+ SampleContentProvided bool `json:"sampleContentProvided"`
100+ }
74101type ConsumptionRequestBody struct {
75102 AccountTenure int32 `json:"accountTenure"`
76103 AppAccountToken string `json:"appAccountToken"`
@@ -86,32 +113,70 @@ type ConsumptionRequestBody struct {
86113 RefundPreference int32 `json:"refundPreference"`
87114}
88115
116+ type AdvancedCommerceDescriptors struct {
117+ Description string `json:"description"`
118+ DisplayName string `json:"displayName"`
119+ }
120+
121+ type AdvancedCommercePriceIncreaseInfo struct {
122+ DependentSKUs []string `json:"dependentSKUs"`
123+ Price int64 `json:"price"`
124+ Status string `json:"status"`
125+ }
126+
127+ type AdvancedCommerceOffer struct {
128+ Period string `json:"period"`
129+ PeriodCount int32 `json:"periodCount"`
130+ Price int64 `json:"price"`
131+ Reason string `json:"reason"`
132+ }
133+
134+ type AdvancedCommerceRenewalItems struct {
135+ SKU string `json:"SKU"`
136+ Description string `json:"description"`
137+ DisplayName string `json:"displayName"`
138+ Offer AdvancedCommerceOffer `json:"offer"`
139+ Price int64 `json:"price"`
140+ PriceIncreaseInfo AdvancedCommercePriceIncreaseInfo `json:"priceIncreaseInfo"`
141+ }
142+
143+ // AdvancedCommerceRenewalInfo https://developer.apple.com/documentation/appstoreserverapi/advancedcommercerenewalinfo
144+ type AdvancedCommerceRenewalInfo struct {
145+ ConsistencyToken string `json:"consistencyToken"`
146+ Descriptors AdvancedCommerceDescriptors `json:"descriptors"`
147+ Items []AdvancedCommerceRenewalItems `json:"items"`
148+ Period string `json:"period"`
149+ RequestReferenceId string `json:"requestReferenceId"`
150+ TaxCode string `json:"taxCode"`
151+ }
152+
89153// Verify that JWSRenewalInfoDecodedPayload implements jwt.Claims
90154var _ jwt.Claims = JWSRenewalInfoDecodedPayload {}
91155
92156// JWSRenewalInfoDecodedPayload https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload
93157type JWSRenewalInfoDecodedPayload struct {
94- AppAccountToken string `json:"appAccountToken,omitempty"`
95- AppTransactionId string `json:"appTransactionId,omitempty"`
96- AutoRenewProductId string `json:"autoRenewProductId"`
97- AutoRenewStatus AutoRenewStatus `json:"autoRenewStatus"`
98- Environment Environment `json:"environment"`
99- ExpirationIntent int32 `json:"expirationIntent"`
100- GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
101- IsInBillingRetryPeriod * bool `json:"isInBillingRetryPeriod"`
102- OfferIdentifier string `json:"offerIdentifier"`
103- OfferType int32 `json:"offerType"`
104- OfferPeriod string `json:"offerPeriod"`
105- OriginalTransactionId string `json:"originalTransactionId"`
106- PriceIncreaseStatus * int32 `json:"priceIncreaseStatus"`
107- ProductId string `json:"productId"`
108- RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
109- RenewalDate int64 `json:"renewalDate"`
110- SignedDate int64 `json:"signedDate"`
111- RenewalPrice int64 `json:"renewalPrice,omitempty"`
112- Currency string `json:"currency,omitempty"`
113- OfferDiscountType OfferDiscountType `json:"offerDiscountType,omitempty"`
114- EligibleWinBackOfferIds []string `json:"eligibleWinBackOfferIds,omitempty"`
158+ AppAccountToken string `json:"appAccountToken,omitempty"`
159+ AppTransactionId string `json:"appTransactionId,omitempty"`
160+ AutoRenewProductId string `json:"autoRenewProductId"`
161+ AutoRenewStatus AutoRenewStatus `json:"autoRenewStatus"`
162+ Environment Environment `json:"environment"`
163+ ExpirationIntent int32 `json:"expirationIntent"`
164+ GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
165+ IsInBillingRetryPeriod * bool `json:"isInBillingRetryPeriod"`
166+ OfferIdentifier string `json:"offerIdentifier"`
167+ OfferType int32 `json:"offerType"`
168+ OfferPeriod string `json:"offerPeriod"`
169+ OriginalTransactionId string `json:"originalTransactionId"`
170+ PriceIncreaseStatus * int32 `json:"priceIncreaseStatus"`
171+ ProductId string `json:"productId"`
172+ RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
173+ RenewalDate int64 `json:"renewalDate"`
174+ SignedDate int64 `json:"signedDate"`
175+ RenewalPrice int64 `json:"renewalPrice,omitempty"`
176+ Currency string `json:"currency,omitempty"`
177+ OfferDiscountType OfferDiscountType `json:"offerDiscountType,omitempty"`
178+ EligibleWinBackOfferIds []string `json:"eligibleWinBackOfferIds,omitempty"`
179+ AdvancedCommerceInfo AdvancedCommerceRenewalInfo `json:"advancedCommerceInfo,omitempty"`
115180}
116181
117182// GetAudience implements jwt.Claims.
@@ -179,6 +244,14 @@ const (
179244 OfferDiscountTypeOneTime OfferDiscountType = "ONE_TIME"
180245)
181246
247+ type RevocationType string
248+
249+ const (
250+ REFUND_FULL RevocationType = "REFUND_FULL"
251+ REFUND_PRORATED RevocationType = "REFUND_PRORATED"
252+ FAMILY_REVOKE RevocationType = "FAMILY_REVOKE"
253+ )
254+
182255// Verify that JWSTransaction implements jwt.Claims
183256var _ jwt.Claims = JWSTransaction {}
184257
@@ -204,6 +277,8 @@ type JWSTransaction struct {
204277 OfferIdentifier string `json:"offerIdentifier,omitempty"`
205278 RevocationDate int64 `json:"revocationDate,omitempty"`
206279 RevocationReason * int32 `json:"revocationReason,omitempty"`
280+ RevocationType RevocationType `json:"revocationType,omitempty"`
281+ RevocationPercentage int32 `json:"revocationPercentage,omitempty"`
207282 IsUpgraded bool `json:"isUpgraded,omitempty"`
208283 Storefront string `json:"storefront,omitempty"`
209284 StorefrontId string `json:"storefrontId,omitempty"`
0 commit comments