@@ -6,7 +6,7 @@ import Foundation
66///[JWSRenewalInfoDecodedPayload](https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload)
77public struct JWSRenewalInfoDecodedPayload : DecodedSignedData , Decodable , Encodable , Hashable {
88
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 ) {
1010 self . expirationIntent = expirationIntent
1111 self . originalTransactionId = originalTransactionId
1212 self . autoRenewProductId = autoRenewProductId
@@ -24,9 +24,10 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
2424 self . currency = currency
2525 self . renewalPrice = renewalPrice
2626 self . offerDiscountType = offerDiscountType
27+ self . eligibleWinBackOfferIds = eligibleWinBackOfferIds
2728 }
2829
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 ) {
3031 self . rawExpirationIntent = rawExpirationIntent
3132 self . originalTransactionId = originalTransactionId
3233 self . autoRenewProductId = autoRenewProductId
@@ -44,6 +45,7 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
4445 self . currency = currency
4546 self . renewalPrice = renewalPrice
4647 self . offerDiscountType = offerDiscountType
48+ self . eligibleWinBackOfferIds = eligibleWinBackOfferIds
4749 }
4850
4951 ///The reason the subscription expired.
@@ -190,6 +192,11 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
190192
191193 ///See ``offerDiscountType``
192194 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 ] ?
193200
194201 public enum CodingKeys : CodingKey {
195202 case expirationIntent
@@ -209,6 +216,7 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
209216 case currency
210217 case renewalPrice
211218 case offerDiscountType
219+ case eligibleWinBackOfferIds
212220 }
213221
214222 public init ( from decoder: any Decoder ) throws {
@@ -230,6 +238,7 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
230238 self . currency = try container. decodeIfPresent ( String . self, forKey: . currency)
231239 self . renewalPrice = try container. decodeIfPresent ( Int64 . self, forKey: . renewalPrice)
232240 self . rawOfferDiscountType = try container. decodeIfPresent ( String . self, forKey: . offerDiscountType)
241+ self . eligibleWinBackOfferIds = try container. decodeIfPresent ( [ String ] . self, forKey: . eligibleWinBackOfferIds)
233242 }
234243
235244 public func encode( to encoder: any Encoder ) throws {
@@ -251,5 +260,6 @@ public struct JWSRenewalInfoDecodedPayload: DecodedSignedData, Decodable, Encoda
251260 try container. encodeIfPresent ( self . currency, forKey: . currency)
252261 try container. encodeIfPresent ( self . renewalPrice, forKey: . renewalPrice)
253262 try container. encodeIfPresent ( self . rawOfferDiscountType, forKey: . offerDiscountType)
263+ try container. encodeIfPresent ( self . eligibleWinBackOfferIds, forKey: . eligibleWinBackOfferIds)
254264 }
255265}
0 commit comments