@@ -6,12 +6,25 @@ public struct AppleVerifyReceiptResponse: Equatable, Sendable {
66 public var receipt : Receipt
77 public var status : Int
88
9+ public init (
10+ environment: AppleVerifyReceiptResponse . Environment ? = nil ,
11+ isRetryable: Bool ,
12+ receipt: AppleVerifyReceiptResponse . Receipt ,
13+ status: Int
14+ ) {
15+ self . environment = environment
16+ self . isRetryable = isRetryable
17+ self . receipt = receipt
18+ self . status = status
19+ }
20+
921 public enum Environment : String , Codable , Equatable , Sendable {
1022 case sandbox = " Sandbox "
1123 case production = " Production "
1224 }
1325
14- public struct Receipt : Equatable , Sendable {
26+ public struct Receipt : Equatable , Sendable {
27+
1528 public var appItemId : Int
1629 public var applicationVersion : String
1730 public var bundleId : String
@@ -20,13 +33,47 @@ public struct AppleVerifyReceiptResponse: Equatable, Sendable {
2033 public var receiptCreationDate : Date
2134 public var requestDate : Date
2235
23- public struct InApp : Equatable , Sendable {
24- public var originalPurchaseDate : Date
25- public var originalTransactionId : String
26- public var productId : String
27- public var purchaseDate : Date
28- public var quantity : Int
29- public var transactionId : String
36+ public init (
37+ appItemId: Int ,
38+ applicationVersion: String ,
39+ bundleId: String ,
40+ inApp: [ AppleVerifyReceiptResponse . Receipt . InApp ] ,
41+ originalPurchaseDate: Date ,
42+ receiptCreationDate: Date ,
43+ requestDate: Date
44+ ) {
45+ self . appItemId = appItemId
46+ self . applicationVersion = applicationVersion
47+ self . bundleId = bundleId
48+ self . inApp = inApp
49+ self . originalPurchaseDate = originalPurchaseDate
50+ self . receiptCreationDate = receiptCreationDate
51+ self . requestDate = requestDate
52+ }
53+
54+ public struct InApp : Equatable , Sendable {
55+ public var originalPurchaseDate : Date
56+ public var originalTransactionId : String
57+ public var productId : String
58+ public var purchaseDate : Date
59+ public var quantity : Int
60+ public var transactionId : String
61+
62+ public init (
63+ originalPurchaseDate: Date ,
64+ originalTransactionId: String ,
65+ productId: String ,
66+ purchaseDate: Date ,
67+ quantity: Int ,
68+ transactionId: String
69+ ) {
70+ self . originalPurchaseDate = originalPurchaseDate
71+ self . originalTransactionId = originalTransactionId
72+ self . productId = productId
73+ self . purchaseDate = purchaseDate
74+ self . quantity = quantity
75+ self . transactionId = transactionId
76+ }
3077 }
3178 }
3279}
0 commit comments