Skip to content

Commit e3a608c

Browse files
committed
Add support to encode fees whe nupdating an order
1 parent 97bb26d commit e3a608c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Networking/Networking/Model/OrderFeeLine.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ extension OrderFeeLine {
4141
public func encode(to encoder: Encoder) throws {
4242
var container = encoder.container(keyedBy: CodingKeys.self)
4343

44+
try container.encode(feeID, forKey: .feeID)
4445
try container.encode(name, forKey: .name)
4546
try container.encode(taxClass, forKey: .taxClass)
4647
try container.encode(taxStatus, forKey: .taxStatus)

Networking/Networking/Remote/OrdersRemote.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ public class OrdersRemote: Remote {
183183
case .billingAddress:
184184
let billingAddressEncoded = try order.billingAddress?.toDictionary()
185185
params[Order.CodingKeys.billingAddress.rawValue] = billingAddressEncoded
186+
case .fees:
187+
let feesEncoded = try order.fees.toDictionary()
188+
params[Order.CodingKeys.feeLines.rawValue] = feesEncoded
186189
}
187190
}
188191
}()
@@ -264,6 +267,7 @@ public extension OrdersRemote {
264267
case customerNote
265268
case shippingAddress
266269
case billingAddress
270+
case fees
267271
}
268272

269273
/// Order fields supported for create

0 commit comments

Comments
 (0)