@@ -6,7 +6,7 @@ import Foundation
6
6
///[JWSRenewalInfoDecodedPayload](https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload)
7
7
public struct JWSRenewalInfoDecodedPayload : DecodedSignedData , Decodable , Encodable , Hashable {
8
8
9
- public init ( expirationIntent: ExpirationIntent ? = nil , originalTransactionId: String ? = nil , autoRenewProductId: String ? = nil , productId: String ? = nil , autoRenewStatus: AutoRenewStatus ? = nil , isInBillingRetryPeriod: Bool ? = nil , priceIncreaseStatus: PriceIncreaseStatus ? = nil , gracePeriodExpiresDate: Date ? = nil , offerType: OfferType ? = nil , offerIdentifier: String ? = nil , signedDate: Date ? = nil , environment: Environment ? = nil , recentSubscriptionStartDate: Date ? = nil , renewalDate: Date ? = nil , currency: String ? = nil , renewalPrice: Int64 ? = nil , offerDiscountType: OfferDiscountType ? = nil ) {
9
+ public init ( expirationIntent: ExpirationIntent ? = nil , originalTransactionId: String ? = nil , autoRenewProductId: String ? = nil , productId: String ? = nil , autoRenewStatus: AutoRenewStatus ? = nil , isInBillingRetryPeriod: Bool ? = nil , priceIncreaseStatus: PriceIncreaseStatus ? = nil , gracePeriodExpiresDate: Date ? = nil , offerType: OfferType ? = nil , offerIdentifier: String ? = nil , signedDate: Date ? = nil , environment: Environment ? = nil , recentSubscriptionStartDate: Date ? = nil , renewalDate: Date ? = nil , currency: String ? = nil , renewalPrice: Int64 ? = nil , offerDiscountType: OfferDiscountType ? = nil , eligibleWinBackOfferIds : [ String ] ? = nil ) {
10
10
self . expirationIntent = expirationIntent
11
11
self . originalTransactionId = originalTransactionId
12
12
self . autoRenewProductId = autoRenewProductId
@@ -24,9 +24,10 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
24
24
self . currency = currency
25
25
self . renewalPrice = renewalPrice
26
26
self . offerDiscountType = offerDiscountType
27
+ self . eligibleWinBackOfferIds = eligibleWinBackOfferIds
27
28
}
28
29
29
- public init ( rawExpirationIntent: Int32 ? = nil , originalTransactionId: String ? = nil , autoRenewProductId: String ? = nil , productId: String ? = nil , rawAutoRenewStatus: Int32 ? = nil , isInBillingRetryPeriod: Bool ? = nil , rawPriceIncreaseStatus: Int32 ? = nil , gracePeriodExpiresDate: Date ? = nil , rawOfferType: Int32 ? = nil , offerIdentifier: String ? = nil , signedDate: Date ? = nil , rawEnvironment: String ? = nil , recentSubscriptionStartDate: Date ? = nil , renewalDate: Date ? = nil , currency: String ? = nil , renewalPrice: Int64 ? = nil , offerDiscountType: OfferDiscountType ? = nil ) {
30
+ public init ( rawExpirationIntent: Int32 ? = nil , originalTransactionId: String ? = nil , autoRenewProductId: String ? = nil , productId: String ? = nil , rawAutoRenewStatus: Int32 ? = nil , isInBillingRetryPeriod: Bool ? = nil , rawPriceIncreaseStatus: Int32 ? = nil , gracePeriodExpiresDate: Date ? = nil , rawOfferType: Int32 ? = nil , offerIdentifier: String ? = nil , signedDate: Date ? = nil , rawEnvironment: String ? = nil , recentSubscriptionStartDate: Date ? = nil , renewalDate: Date ? = nil , currency: String ? = nil , renewalPrice: Int64 ? = nil , offerDiscountType: OfferDiscountType ? = nil , eligibleWinBackOfferIds : [ String ] ? = nil ) {
30
31
self . rawExpirationIntent = rawExpirationIntent
31
32
self . originalTransactionId = originalTransactionId
32
33
self . autoRenewProductId = autoRenewProductId
@@ -44,6 +45,7 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
44
45
self . currency = currency
45
46
self . renewalPrice = renewalPrice
46
47
self . offerDiscountType = offerDiscountType
48
+ self . eligibleWinBackOfferIds = eligibleWinBackOfferIds
47
49
}
48
50
49
51
///The reason the subscription expired.
@@ -190,6 +192,11 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
190
192
191
193
///See ``offerDiscountType``
192
194
public var rawOfferDiscountType : String ?
195
+
196
+ ///An array of win-back offer identifiers that a customer is eligible to redeem, which sorts the identifiers to present the better offers first.
197
+ ///
198
+ ///[eligibleWinBackOfferIds](https://developer.apple.com/documentation/appstoreserverapi/eligiblewinbackofferids)
199
+ public var eligibleWinBackOfferIds : [ String ] ?
193
200
194
201
public enum CodingKeys : CodingKey {
195
202
case expirationIntent
@@ -209,6 +216,7 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
209
216
case currency
210
217
case renewalPrice
211
218
case offerDiscountType
219
+ case eligibleWinBackOfferIds
212
220
}
213
221
214
222
public init ( from decoder: any Decoder ) throws {
@@ -230,6 +238,7 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
230
238
self . currency = try container. decodeIfPresent ( String . self, forKey: . currency)
231
239
self . renewalPrice = try container. decodeIfPresent ( Int64 . self, forKey: . renewalPrice)
232
240
self . rawOfferDiscountType = try container. decodeIfPresent ( String . self, forKey: . offerDiscountType)
241
+ self . eligibleWinBackOfferIds = try container. decodeIfPresent ( [ String ] . self, forKey: . eligibleWinBackOfferIds)
233
242
}
234
243
235
244
public func encode( to encoder: any Encoder ) throws {
@@ -251,5 +260,6 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
251
260
try container. encodeIfPresent ( self . currency, forKey: . currency)
252
261
try container. encodeIfPresent ( self . renewalPrice, forKey: . renewalPrice)
253
262
try container. encodeIfPresent ( self . rawOfferDiscountType, forKey: . offerDiscountType)
263
+ try container. encodeIfPresent ( self . eligibleWinBackOfferIds, forKey: . eligibleWinBackOfferIds)
254
264
}
255
265
}
0 commit comments