@@ -8,22 +8,30 @@ type OrderLookupResponse struct {
8
8
SignedTransactions []string `json:"signedTransactions"`
9
9
}
10
10
11
+ type Environment string
12
+
13
+ // Environment https://developer.apple.com/documentation/appstoreserverapi/environment
14
+ const (
15
+ Sandbox Environment = "Sandbox"
16
+ Production Environment = "Production"
17
+ )
18
+
11
19
// HistoryResponse https://developer.apple.com/documentation/appstoreserverapi/historyresponse
12
20
type HistoryResponse struct {
13
- AppAppleId int `json:"appAppleId"`
14
- BundleId string `json:"bundleId"`
15
- Environment string `json:"environment"`
16
- HasMore bool `json:"hasMore"`
17
- Revision string `json:"revision"`
18
- SignedTransactions []string `json:"signedTransactions"`
21
+ AppAppleId int64 `json:"appAppleId"`
22
+ BundleId string `json:"bundleId"`
23
+ Environment Environment `json:"environment"`
24
+ HasMore bool `json:"hasMore"`
25
+ Revision string `json:"revision"`
26
+ SignedTransactions []string `json:"signedTransactions"`
19
27
}
20
28
21
29
// TransactionInfoResponse https://developer.apple.com/documentation/appstoreserverapi/transactioninforesponse
22
30
type TransactionInfoResponse struct {
23
31
SignedTransactionInfo string `json:"signedTransactionInfo"`
24
32
}
25
33
26
- // RefundLookupResponse https://developer.apple.com/documentation/appstoreserverapi/refundlookupresponse
34
+ // RefundLookupResponse same as the RefundHistoryResponse https://developer.apple.com/documentation/appstoreserverapi/refundhistoryresponse
27
35
type RefundLookupResponse struct {
28
36
HasMore bool `json:"hasMore"`
29
37
Revision string `json:"revision"`
@@ -32,8 +40,8 @@ type RefundLookupResponse struct {
32
40
33
41
// StatusResponse https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses
34
42
type StatusResponse struct {
35
- Environment string `json:"environment"`
36
- AppAppleId int `json:"appAppleId"`
43
+ Environment Environment `json:"environment"`
44
+ AppAppleId int64 `json:"appAppleId"`
37
45
BundleId string `json:"bundleId"`
38
46
Data []SubscriptionGroupIdentifierItem `json:"data"`
39
47
}
@@ -45,36 +53,51 @@ type SubscriptionGroupIdentifierItem struct {
45
53
46
54
type LastTransactionsItem struct {
47
55
OriginalTransactionId string `json:"originalTransactionId"`
48
- Status int `json:"status"`
56
+ Status int32 `json:"status"`
49
57
SignedRenewalInfo string `json:"signedRenewalInfo"`
50
58
SignedTransactionInfo string `json:"signedTransactionInfo"`
51
59
}
52
60
53
61
// MassExtendRenewalDateRequest https://developer.apple.com/documentation/appstoreserverapi/massextendrenewaldaterequest
54
62
type MassExtendRenewalDateRequest struct {
55
63
RequestIdentifier string `json:"requestIdentifier"`
56
- ExtendByDays int `json:"extendByDays"`
57
- ExtendReasonCode int `json:"extendReasonCode"`
64
+ ExtendByDays int32 `json:"extendByDays"`
65
+ ExtendReasonCode int32 `json:"extendReasonCode"`
58
66
ProductId string `json:"productId"`
59
67
StorefrontCountryCodes []string `json:"storefrontCountryCodes"`
60
68
}
61
69
62
70
// ConsumptionRequestBody https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest
63
71
type ConsumptionRequestBody struct {
64
- AccountTenure int `json:"accountTenure"`
72
+ AccountTenure int32 `json:"accountTenure"`
65
73
AppAccountToken string `json:"appAccountToken"`
66
- ConsumptionStatus int `json:"consumptionStatus"`
74
+ ConsumptionStatus int32 `json:"consumptionStatus"`
67
75
CustomerConsented bool `json:"customerConsented"`
68
- DeliveryStatus int `json:"deliveryStatus"`
69
- LifetimeDollarsPurchased int `json:"lifetimeDollarsPurchased"`
70
- LifetimeDollarsRefunded int `json:"lifetimeDollarsRefunded"`
71
- Platform int `json:"platform"`
72
- PlayTime int `json:"playTime"`
76
+ DeliveryStatus int32 `json:"deliveryStatus"`
77
+ LifetimeDollarsPurchased int32 `json:"lifetimeDollarsPurchased"`
78
+ LifetimeDollarsRefunded int32 `json:"lifetimeDollarsRefunded"`
79
+ Platform int32 `json:"platform"`
80
+ PlayTime int32 `json:"playTime"`
73
81
SampleContentProvided bool `json:"sampleContentProvided"`
74
- UserStatus int `json:"userStatus"`
82
+ UserStatus int32 `json:"userStatus"`
75
83
}
76
84
85
+ // JWSRenewalInfoDecodedPayload https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload
77
86
type JWSRenewalInfoDecodedPayload struct {
87
+ AutoRenewProductId string `json:"autoRenewProductId"`
88
+ AutoRenewStatus int32 `json:"autoRenewStatus"`
89
+ Environment Environment `json:"environment"`
90
+ ExpirationIntent int32 `json:"expirationIntent"`
91
+ GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
92
+ IsInBillingRetryPeriod bool `json:"isInBillingRetryPeriod"`
93
+ OfferIdentifier string `json:"offerIdentifier"`
94
+ OfferType string `json:"offerType"`
95
+ OriginalTransactionId string `json:"originalTransactionId"`
96
+ PriceIncreaseStatus int32 `json:"priceIncreaseStatus"`
97
+ ProductId string `json:"productId"`
98
+ RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
99
+ RenewalDate int64 `json:"renewalDate"`
100
+ SignedDate int64 `json:"signedDate"`
78
101
}
79
102
80
103
// JWSDecodedHeader https://developer.apple.com/documentation/appstoreserverapi/jwsdecodedheader
@@ -114,27 +137,28 @@ type JWSTransaction struct {
114
137
PurchaseDate int64 `json:"purchaseDate,omitempty"`
115
138
OriginalPurchaseDate int64 `json:"originalPurchaseDate,omitempty"`
116
139
ExpiresDate int64 `json:"expiresDate,omitempty"`
117
- Quantity int64 `json:"quantity,omitempty"`
140
+ Quantity int32 `json:"quantity,omitempty"`
118
141
Type IAPType `json:"type,omitempty"`
119
142
AppAccountToken string `json:"appAccountToken,omitempty"`
120
143
InAppOwnershipType string `json:"inAppOwnershipType,omitempty"`
121
144
SignedDate int64 `json:"signedDate,omitempty"`
122
- OfferType int64 `json:"offerType,omitempty"`
145
+ OfferType int32 `json:"offerType,omitempty"`
123
146
OfferIdentifier string `json:"offerIdentifier,omitempty"`
124
147
RevocationDate int64 `json:"revocationDate,omitempty"`
125
- RevocationReason int `json:"revocationReason,omitempty"`
148
+ RevocationReason int32 `json:"revocationReason,omitempty"`
126
149
IsUpgraded bool `json:"isUpgraded,omitempty"`
127
- Storefront string `json:"storefront"`
128
- StorefrontId string `json:"storefrontId"`
129
- TransactionReason TransactionReason `json:"transactionReason"`
150
+ Storefront string `json:"storefront,omitempty"`
151
+ StorefrontId string `json:"storefrontId,omitempty"`
152
+ TransactionReason TransactionReason `json:"transactionReason,omitempty"`
153
+ Environment Environment `json:"environment,omitempty"`
130
154
}
131
155
132
156
func (J JWSTransaction ) Valid () error {
133
157
return nil
134
158
}
135
159
136
160
// https://developer.apple.com/documentation/appstoreserverapi/extendreasoncode
137
- type ExtendReasonCode int
161
+ type ExtendReasonCode int32
138
162
139
163
const (
140
164
UndeclaredExtendReasonCode = iota
@@ -145,11 +169,20 @@ const (
145
169
146
170
// ExtendRenewalDateRequest https://developer.apple.com/documentation/appstoreserverapi/extendrenewaldaterequest
147
171
type ExtendRenewalDateRequest struct {
148
- ExtendByDays int `json:"extendByDays"`
172
+ ExtendByDays int32 `json:"extendByDays"`
149
173
ExtendReasonCode ExtendReasonCode `json:"extendReasonCode"`
150
174
RequestIdentifier string `json:"requestIdentifier"`
151
175
}
152
176
177
+ // MassExtendRenewalDateStatusResponse https://developer.apple.com/documentation/appstoreserverapi/massextendrenewaldatestatusresponse
178
+ type MassExtendRenewalDateStatusResponse struct {
179
+ RequestIdentifier string `json:"requestIdentifier"`
180
+ Complete bool `json:"complete"`
181
+ CompleteDate int64 `json:"completeDate,omitempty"`
182
+ FailedCount int64 `json:"failedCount,omitempty"`
183
+ SucceededCount int64 `json:"succeededCount,omitempty"`
184
+ }
185
+
153
186
// NotificationHistoryRequest https://developer.apple.com/documentation/appstoreserverapi/notificationhistoryrequest
154
187
type NotificationHistoryRequest struct {
155
188
StartDate int64 `json:"startDate"`
0 commit comments