@@ -2,7 +2,7 @@ import Foundation
22import StoreKit
33
44@available ( iOS 16 . 0 , macOS 13 . 0 , * )
5- public struct IapAppTransaction : Codable {
5+ public struct OpenIapAppTransaction : Codable {
66 public let bundleId : String
77 public let appVersion : String
88 public let originalAppVersion : String
@@ -21,7 +21,7 @@ public struct IapAppTransaction: Codable {
2121}
2222
2323@available ( iOS 16 . 0 , macOS 13 . 0 , * )
24- extension IapAppTransaction {
24+ extension OpenIapAppTransaction {
2525 init ( from appTransaction: AppTransaction ) {
2626 self . bundleId = appTransaction. bundleID
2727 self . appVersion = appTransaction. appVersion
@@ -50,12 +50,12 @@ extension IapAppTransaction {
5050 }
5151}
5252
53- public struct IapSubscriptionStatus : Codable {
53+ public struct OpenIapSubscriptionStatus : Codable {
5454 public let state : String
55- public let renewalInfo : IapRenewalInfo ?
55+ public let renewalInfo : OpenIapRenewalInfo ?
5656}
5757
58- public struct IapRenewalInfo : Codable {
58+ public struct OpenIapRenewalInfo : Codable {
5959 public let autoRenewStatus : Bool
6060 public let autoRenewPreference : String ?
6161 public let expirationReason : Int ?
@@ -64,16 +64,16 @@ public struct IapRenewalInfo: Codable {
6464 public let gracePeriodExpirationDate : Date ?
6565}
6666
67- public struct IapValidationResult : Codable {
67+ public struct OpenIapValidationResult : Codable {
6868 public let isValid : Bool
6969 public let receiptData : String
7070 public let jwsRepresentation : String
71- public let latestTransaction : IapPurchase ?
71+ public let latestTransaction : OpenIapPurchase ?
7272}
7373
7474// MARK: - Product and Transaction serialization models
7575
76- public struct IapProductData : Codable {
76+ public struct OpenIapProductData : Codable {
7777 public let id : String
7878 public let title : String
7979 public let description : String
@@ -95,67 +95,26 @@ public struct IapProductData: Codable {
9595 }
9696}
9797
98- public struct IapTransactionData : Codable {
99- public let id : String
100- public let productId : String
101- public let transactionId : String
102- public let transactionDate : Double
103- public let transactionReceipt : String
104- public let platform : String
105- public let quantityIOS : Int
106- public let originalTransactionDateIOS : Double
107- public let originalTransactionIdentifierIOS : String
108- public let appAccountToken : String ?
109- public let productTypeIOS : String
110- public let isUpgradedIOS : Bool
111- public let ownershipTypeIOS : String
112- public let revocationDateIOS : Double ?
113- public let revocationReasonIOS : Int ?
114- public let expirationDateIOS : Double ?
115- public let jwsRepresentationIOS : String ?
116- public let purchaseToken : String ?
117- public let environmentIOS : String ?
118-
119- public init ( id: String , productId: String , transactionId: String , transactionDate: Double , transactionReceipt: String , platform: String = " ios " , quantityIOS: Int , originalTransactionDateIOS: Double , originalTransactionIdentifierIOS: String , appAccountToken: String ? , productTypeIOS: String , isUpgradedIOS: Bool , ownershipTypeIOS: String , revocationDateIOS: Double ? , revocationReasonIOS: Int ? , expirationDateIOS: Double ? , jwsRepresentationIOS: String ? , purchaseToken: String ? , environmentIOS: String ? ) {
120- self . id = id
121- self . productId = productId
122- self . transactionId = transactionId
123- self . transactionDate = transactionDate
124- self . transactionReceipt = transactionReceipt
125- self . platform = platform
126- self . quantityIOS = quantityIOS
127- self . originalTransactionDateIOS = originalTransactionDateIOS
128- self . originalTransactionIdentifierIOS = originalTransactionIdentifierIOS
129- self . appAccountToken = appAccountToken
130- self . productTypeIOS = productTypeIOS
131- self . isUpgradedIOS = isUpgradedIOS
132- self . ownershipTypeIOS = ownershipTypeIOS
133- self . revocationDateIOS = revocationDateIOS
134- self . revocationReasonIOS = revocationReasonIOS
135- self . expirationDateIOS = expirationDateIOS
136- self . jwsRepresentationIOS = jwsRepresentationIOS
137- self . purchaseToken = purchaseToken
138- self . environmentIOS = environmentIOS
139- }
140- }
98+ // IapTransactionData is deprecated - use OpenIapPurchase instead
99+ // This type has been merged into OpenIapPurchase for better API consistency
141100
142- public struct IapPromotedProduct : Codable {
101+ public struct OpenIapPromotedProduct : Codable {
143102 public let productIdentifier : String
144103 public let localizedTitle : String
145104 public let localizedDescription : String
146105 public let price : Double
147- public let priceLocale : IapPriceLocale
106+ public let priceLocale : OpenIapPriceLocale
148107}
149108
150- public struct IapPriceLocale : Codable {
109+ public struct OpenIapPriceLocale : Codable {
151110 public let currencyCode : String
152111 public let currencySymbol : String
153112 public let countryCode : String
154113}
155114
156- public struct IapReceiptValidation : Codable {
115+ public struct OpenIapReceiptValidation : Codable {
157116 public let isValid : Bool
158117 public let receiptData : String
159118 public let jwsRepresentation : String
160- public let latestTransaction : IapTransactionData ?
119+ public let latestTransaction : OpenIapPurchase ?
161120}
0 commit comments