@@ -24,7 +24,7 @@ public struct WCPayCharge: Decodable, GeneratedCopiable, GeneratedFakeable, Equa
2424 public let amountRefunded : Int64
2525
2626 /// The authorization code for the charge. This is not part of the Stripe model, but a WCPay-added field.
27- public let authorizationCode : String
27+ public let authorizationCode : String ?
2828
2929 /// Whether the charge has been captured yet
3030 public let captured : Bool
@@ -58,7 +58,7 @@ public struct WCPayCharge: Decodable, GeneratedCopiable, GeneratedFakeable, Equa
5858 amount: Int64 ,
5959 amountCaptured: Int64 ,
6060 amountRefunded: Int64 ,
61- authorizationCode: String ,
61+ authorizationCode: String ? ,
6262 captured: Bool ,
6363 created: Date ,
6464 currency: String ,
@@ -98,7 +98,7 @@ public struct WCPayCharge: Decodable, GeneratedCopiable, GeneratedFakeable, Equa
9898 let amount = try container. decode ( Int64 . self, forKey: . amount)
9999 let amountCaptured = try container. decode ( Int64 . self, forKey: . amountCaptured)
100100 let amountRefunded = try container. decode ( Int64 . self, forKey: . amountRefunded)
101- let authorizationCode = try container. decode ( String . self, forKey: . authorizationCode)
101+ let authorizationCode = try container. decodeIfPresent ( String . self, forKey: . authorizationCode)
102102 let captured = try container. decode ( Bool . self, forKey: . captured)
103103 let created = try container. decode ( Date . self, forKey: . created)
104104 let currency = try container. decode ( String . self, forKey: . currency)
0 commit comments