Skip to content

Commit 9548f08

Browse files
committed
5976 Update WCPayChargeModel for card payments
1 parent 8cb4a4c commit 9548f08

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Networking/Networking/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ extension WCPayCharge {
17631763
amount: CopiableProp<Int64> = .copy,
17641764
amountCaptured: CopiableProp<Int64> = .copy,
17651765
amountRefunded: CopiableProp<Int64> = .copy,
1766-
authorizationCode: CopiableProp<String> = .copy,
1766+
authorizationCode: NullableCopiableProp<String> = .copy,
17671767
captured: CopiableProp<Bool> = .copy,
17681768
created: CopiableProp<Date> = .copy,
17691769
currency: CopiableProp<String> = .copy,

Networking/Networking/Model/WCPayCharge.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)