1
1
package api
2
2
3
- import "github.com/awa/go-iap/appstore"
3
+ import (
4
+ "github.com/awa/go-iap/appstore"
5
+ "github.com/golang-jwt/jwt/v5"
6
+ )
4
7
5
8
// OrderLookupResponse https://developer.apple.com/documentation/appstoreserverapi/orderlookupresponse
6
9
type OrderLookupResponse struct {
@@ -83,6 +86,9 @@ type ConsumptionRequestBody struct {
83
86
RefundPreference int32 `json:"refundPreference"`
84
87
}
85
88
89
+ // Verify that JWSRenewalInfoDecodedPayload implements jwt.Claims
90
+ var _ jwt.Claims = JWSRenewalInfoDecodedPayload {}
91
+
86
92
// JWSRenewalInfoDecodedPayload https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload
87
93
type JWSRenewalInfoDecodedPayload struct {
88
94
AutoRenewProductId string `json:"autoRenewProductId"`
@@ -105,8 +111,34 @@ type JWSRenewalInfoDecodedPayload struct {
105
111
EligibleWinBackOfferIds []string `json:"eligibleWinBackOfferIds,omitempty"`
106
112
}
107
113
108
- func (J JWSRenewalInfoDecodedPayload ) Valid () error {
109
- return nil
114
+ // GetAudience implements jwt.Claims.
115
+ func (J JWSRenewalInfoDecodedPayload ) GetAudience () (jwt.ClaimStrings , error ) {
116
+ return nil , nil
117
+ }
118
+
119
+ // GetExpirationTime implements jwt.Claims.
120
+ func (J JWSRenewalInfoDecodedPayload ) GetExpirationTime () (* jwt.NumericDate , error ) {
121
+ return nil , nil
122
+ }
123
+
124
+ // GetIssuedAt implements jwt.Claims.
125
+ func (J JWSRenewalInfoDecodedPayload ) GetIssuedAt () (* jwt.NumericDate , error ) {
126
+ return nil , nil
127
+ }
128
+
129
+ // GetIssuer implements jwt.Claims.
130
+ func (J JWSRenewalInfoDecodedPayload ) GetIssuer () (string , error ) {
131
+ return "" , nil
132
+ }
133
+
134
+ // GetNotBefore implements jwt.Claims.
135
+ func (J JWSRenewalInfoDecodedPayload ) GetNotBefore () (* jwt.NumericDate , error ) {
136
+ return nil , nil
137
+ }
138
+
139
+ // GetSubject implements jwt.Claims.
140
+ func (J JWSRenewalInfoDecodedPayload ) GetSubject () (string , error ) {
141
+ return "" , nil
110
142
}
111
143
112
144
// JWSDecodedHeader https://developer.apple.com/documentation/appstoreserverapi/jwsdecodedheader
@@ -143,6 +175,9 @@ const (
143
175
OfferDiscountTypePayUpFront OfferDiscountType = "PAY_UP_FRONT"
144
176
)
145
177
178
+ // Verify that JWSTransaction implements jwt.Claims
179
+ var _ jwt.Claims = JWSTransaction {}
180
+
146
181
// JWSTransaction https://developer.apple.com/documentation/appstoreserverapi/jwstransaction
147
182
type JWSTransaction struct {
148
183
TransactionID string `json:"transactionId,omitempty"`
@@ -173,8 +208,34 @@ type JWSTransaction struct {
173
208
OfferDiscountType OfferDiscountType `json:"offerDiscountType,omitempty"`
174
209
}
175
210
176
- func (J JWSTransaction ) Valid () error {
177
- return nil
211
+ // GetAudience implements jwt.Claims.
212
+ func (J JWSTransaction ) GetAudience () (jwt.ClaimStrings , error ) {
213
+ return nil , nil
214
+ }
215
+
216
+ // GetExpirationTime implements jwt.Claims.
217
+ func (J JWSTransaction ) GetExpirationTime () (* jwt.NumericDate , error ) {
218
+ return nil , nil
219
+ }
220
+
221
+ // GetIssuedAt implements jwt.Claims.
222
+ func (J JWSTransaction ) GetIssuedAt () (* jwt.NumericDate , error ) {
223
+ return nil , nil
224
+ }
225
+
226
+ // GetIssuer implements jwt.Claims.
227
+ func (J JWSTransaction ) GetIssuer () (string , error ) {
228
+ return "" , nil
229
+ }
230
+
231
+ // GetNotBefore implements jwt.Claims.
232
+ func (J JWSTransaction ) GetNotBefore () (* jwt.NumericDate , error ) {
233
+ return nil , nil
234
+ }
235
+
236
+ // GetSubject implements jwt.Claims.
237
+ func (J JWSTransaction ) GetSubject () (string , error ) {
238
+ return "" , nil
178
239
}
179
240
180
241
// https://developer.apple.com/documentation/appstoreserverapi/extendreasoncode
@@ -258,8 +319,10 @@ type SendTestNotificationResponse struct {
258
319
TestNotificationToken string `json:"testNotificationToken"`
259
320
}
260
321
261
- type AutoRenewSubscriptionStatus int32
262
- type AutoRenewStatus int32
322
+ type (
323
+ AutoRenewSubscriptionStatus int32
324
+ AutoRenewStatus int32
325
+ )
263
326
264
327
const (
265
328
SubscriptionActive AutoRenewSubscriptionStatus = 1
0 commit comments