Skip to content

Commit ccda6d3

Browse files
Merge pull request #198 from woocommerce/develop
Merging Mark 0.4 into Master
2 parents af3bd9e + e2cdc45 commit ccda6d3

File tree

116 files changed

+5256
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+5256
-448
lines changed

Networking/Networking.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
B56C1EB620EA757B00D749F9 /* SiteListMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56C1EB520EA757B00D749F9 /* SiteListMapper.swift */; };
5151
B56C1EB820EA76F500D749F9 /* Site.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56C1EB720EA76F500D749F9 /* Site.swift */; };
5252
B56C1EBA20EA7D2C00D749F9 /* sites.json in Resources */ = {isa = PBXBuildFile; fileRef = B56C1EB920EA7D2C00D749F9 /* sites.json */; };
53+
B58E5BEA20FFB3D0003C986E /* CodingUserInfoKey+Woo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B58E5BE920FFB3D0003C986E /* CodingUserInfoKey+Woo.swift */; };
5354
B5969E1520A47F99005E9DF1 /* RemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5969E1420A47F99005E9DF1 /* RemoteTests.swift */; };
5455
B5BB1D0C20A2050300112D92 /* DateFormatter+Woo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BB1D0B20A2050300112D92 /* DateFormatter+Woo.swift */; };
5556
B5BB1D1020A237FB00112D92 /* Address.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BB1D0F20A237FB00112D92 /* Address.swift */; };
@@ -60,6 +61,8 @@
6061
B5C6FCD420A373BB00A4F8E4 /* OrderMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C6FCD320A373BA00A4F8E4 /* OrderMapper.swift */; };
6162
B5C6FCD620A3768900A4F8E4 /* order.json in Resources */ = {isa = PBXBuildFile; fileRef = B5C6FCD520A3768900A4F8E4 /* order.json */; };
6263
CE20179320E3EFA7005B4C18 /* broken-orders.json in Resources */ = {isa = PBXBuildFile; fileRef = CE20179220E3EFA7005B4C18 /* broken-orders.json */; };
64+
CE21B3E72106811000A259D5 /* new-order-note.json in Resources */ = {isa = PBXBuildFile; fileRef = CE21B3E62106811000A259D5 /* new-order-note.json */; };
65+
CE583A0E2109154500D73C1C /* OrderNoteMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE583A0D2109154500D73C1C /* OrderNoteMapper.swift */; };
6366
/* End PBXBuildFile section */
6467

6568
/* Begin PBXContainerItemProxy section */
@@ -119,6 +122,7 @@
119122
B56C1EB520EA757B00D749F9 /* SiteListMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteListMapper.swift; sourceTree = "<group>"; };
120123
B56C1EB720EA76F500D749F9 /* Site.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Site.swift; sourceTree = "<group>"; };
121124
B56C1EB920EA7D2C00D749F9 /* sites.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = sites.json; sourceTree = "<group>"; };
125+
B58E5BE920FFB3D0003C986E /* CodingUserInfoKey+Woo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CodingUserInfoKey+Woo.swift"; sourceTree = "<group>"; };
122126
B5969E1420A47F99005E9DF1 /* RemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteTests.swift; sourceTree = "<group>"; };
123127
B5BB1D0B20A2050300112D92 /* DateFormatter+Woo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Woo.swift"; sourceTree = "<group>"; };
124128
B5BB1D0F20A237FB00112D92 /* Address.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Address.swift; sourceTree = "<group>"; };
@@ -131,6 +135,8 @@
131135
BD9439D9B8F2C1ED2EADAA51 /* Pods-NetworkingTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetworkingTests.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-NetworkingTests/Pods-NetworkingTests.debug.xcconfig"; sourceTree = "<group>"; };
132136
C8F9A8CC6F90A8C9B5EF2EE2 /* Pods-Networking.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Networking.release.xcconfig"; path = "../Pods/Target Support Files/Pods-Networking/Pods-Networking.release.xcconfig"; sourceTree = "<group>"; };
133137
CE20179220E3EFA7005B4C18 /* broken-orders.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "broken-orders.json"; sourceTree = "<group>"; };
138+
CE21B3E62106811000A259D5 /* new-order-note.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "new-order-note.json"; sourceTree = "<group>"; };
139+
CE583A0D2109154500D73C1C /* OrderNoteMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderNoteMapper.swift; sourceTree = "<group>"; };
134140
F3F25DC15EC1D7C631169CB5 /* Pods_Networking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Networking.framework; sourceTree = BUILT_PRODUCTS_DIR; };
135141
F6CEE1CA2AD376C0C28AE9F6 /* Pods-NetworkingTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetworkingTests.release.xcconfig"; path = "../Pods/Target Support Files/Pods-NetworkingTests/Pods-NetworkingTests.release.xcconfig"; sourceTree = "<group>"; };
136142
/* End PBXFileReference section */
@@ -312,6 +318,7 @@
312318
B559EBA820A0B5B100836CD4 /* Responses */ = {
313319
isa = PBXGroup;
314320
children = (
321+
CE21B3E62106811000A259D5 /* new-order-note.json */,
315322
B505F6D420BEE4E600BB1B69 /* me.json */,
316323
B559EBA920A0B5CD00836CD4 /* orders-load-all.json */,
317324
B5C6FCD520A3768900A4F8E4 /* order.json */,
@@ -333,6 +340,7 @@
333340
B567AF2A20A0FA4200AB6C62 /* OrderListMapper.swift */,
334341
B56C1EB520EA757B00D749F9 /* SiteListMapper.swift */,
335342
74C8F06720EEB7BC00B6EDC9 /* OrderNotesMapper.swift */,
343+
CE583A0D2109154500D73C1C /* OrderNoteMapper.swift */,
336344
);
337345
path = Mapper;
338346
sourceTree = "<group>";
@@ -341,6 +349,7 @@
341349
isa = PBXGroup;
342350
children = (
343351
B5BB1D0B20A2050300112D92 /* DateFormatter+Woo.swift */,
352+
B58E5BE920FFB3D0003C986E /* CodingUserInfoKey+Woo.swift */,
344353
);
345354
path = Extensions;
346355
sourceTree = "<group>";
@@ -479,6 +488,7 @@
479488
files = (
480489
74C8F06620EEB76400B6EDC9 /* order-notes.json in Resources */,
481490
74C8F06C20EEBD5D00B6EDC9 /* broken-order.json in Resources */,
491+
CE21B3E72106811000A259D5 /* new-order-note.json in Resources */,
482492
B505F6D520BEE4E700BB1B69 /* me.json in Resources */,
483493
B5C6FCD620A3768900A4F8E4 /* order.json in Resources */,
484494
B559EBAA20A0B5CD00836CD4 /* orders-load-all.json in Resources */,
@@ -556,6 +566,7 @@
556566
files = (
557567
B56C1EB620EA757B00D749F9 /* SiteListMapper.swift in Sources */,
558568
B557DA1A20979D66005962F4 /* Settings.swift in Sources */,
569+
B58E5BEA20FFB3D0003C986E /* CodingUserInfoKey+Woo.swift in Sources */,
559570
741B950120EBC8A700DD6E2D /* OrderCouponLine.swift in Sources */,
560571
74C8F06420EEB44800B6EDC9 /* OrderNote.swift in Sources */,
561572
B5BB1D0C20A2050300112D92 /* DateFormatter+Woo.swift in Sources */,
@@ -571,6 +582,7 @@
571582
B518662220A097C200037A38 /* Network.swift in Sources */,
572583
B518662420A099BF00037A38 /* AlamofireNetwork.swift in Sources */,
573584
B557DA1820979D51005962F4 /* Credentials.swift in Sources */,
585+
CE583A0E2109154500D73C1C /* OrderNoteMapper.swift in Sources */,
574586
B5C6FCCF20A3592900A4F8E4 /* OrderItem.swift in Sources */,
575587
B505F6EC20BEFDC200BB1B69 /* Loader.swift in Sources */,
576588
B5BB1D1220A255EC00112D92 /* OrderStatus.swift in Sources */,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Foundation
2+
3+
4+
/// WooCommerce CodingUserInfoKey(s)
5+
///
6+
extension CodingUserInfoKey {
7+
8+
/// Used to store the SiteID within a Coder/Decoder's userInfo dictionary.
9+
///
10+
public static let siteID = CodingUserInfoKey(rawValue: "siteID")!
11+
}

Networking/Networking/Mapper/OrderListMapper.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@ import Foundation
33

44
/// Mapper: OrderList
55
///
6-
class OrderListMapper: Mapper {
6+
struct OrderListMapper: Mapper {
7+
8+
/// Site Identifier associated to the orders that will be parsed.
9+
/// We're injecting this field via `JSONDecoder.userInfo` because the remote endpoints don't really return the SiteID in any of the
10+
/// Order Endpoints.
11+
///
12+
let siteID: Int
13+
714

815
/// (Attempts) to convert a dictionary into [Order].
916
///
1017
func map(response: Data) throws -> [Order] {
1118
let decoder = JSONDecoder()
1219
decoder.dateDecodingStrategy = .formatted(DateFormatter.Defaults.dateTimeFormatter)
20+
decoder.userInfo = [
21+
.siteID: siteID
22+
]
1323

1424
return try decoder.decode(OrderListEnvelope.self, from: response).orders
1525
}

Networking/Networking/Mapper/OrderMapper.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@ import Foundation
33

44
/// Mapper: Order
55
///
6-
class OrderMapper: Mapper {
6+
struct OrderMapper: Mapper {
7+
8+
/// Site Identifier associated to the orders that will be parsed.
9+
/// We're injecting this field via `JSONDecoder.userInfo` because the remote endpoints don't really return the SiteID in any of the
10+
/// Order Endpoints.
11+
///
12+
let siteID: Int
13+
714

815
/// (Attempts) to convert a dictionary into [Order].
916
///
1017
func map(response: Data) throws -> Order {
1118
let decoder = JSONDecoder()
1219
decoder.dateDecodingStrategy = .formatted(DateFormatter.Defaults.dateTimeFormatter)
20+
decoder.userInfo = [
21+
.siteID: siteID
22+
]
1323

1424
return try decoder.decode(OrderEnvelope.self, from: response).order
1525
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Foundation
2+
3+
4+
/// Mapper: OrderNote (Singular)
5+
///
6+
class OrderNoteMapper: Mapper {
7+
8+
/// (Attempts) to convert a dictionary into a single OrderNote
9+
///
10+
func map(response: Data) throws -> OrderNote {
11+
let decoder = JSONDecoder()
12+
decoder.dateDecodingStrategy = .formatted(DateFormatter.Defaults.dateTimeFormatter)
13+
14+
return try decoder.decode(OrderNoteEnvelope.self, from: response).orderNote
15+
}
16+
}
17+
18+
19+
/// OrderNote Disposable Entity:
20+
/// `Add Order Note` endpoint the single added note within the `data` key. This entity
21+
/// allows us to parse all the things with JSONDecoder.
22+
///
23+
private struct OrderNoteEnvelope: Decodable {
24+
let orderNote: OrderNote
25+
26+
private enum CodingKeys: String, CodingKey {
27+
case orderNote = "data"
28+
}
29+
}

Networking/Networking/Model/Order.swift

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Foundation
44
/// Represents an Order Entity.
55
///
66
public struct Order: Decodable {
7+
public let siteID: Int
78
public let orderID: Int
89
public let parentID: Int
910
public let customerID: Int
@@ -32,8 +33,30 @@ public struct Order: Decodable {
3233

3334
/// Order struct initializer.
3435
///
35-
public init(orderID: Int, parentID: Int, customerID: Int, number: String, status: OrderStatus, currency: String, customerNote: String?, dateCreated: Date, dateModified: Date, datePaid: Date?, discountTotal: String, discountTax: String, shippingTotal: String, shippingTax: String, total: String, totalTax: String, paymentMethodTitle: String, items: [OrderItem], billingAddress: Address, shippingAddress: Address, coupons: [OrderCouponLine]) {
36-
36+
public init(siteID: Int,
37+
orderID: Int,
38+
parentID: Int,
39+
customerID: Int,
40+
number: String,
41+
status: OrderStatus,
42+
currency: String,
43+
customerNote: String?,
44+
dateCreated: Date,
45+
dateModified: Date,
46+
datePaid: Date?,
47+
discountTotal: String,
48+
discountTax: String,
49+
shippingTotal: String,
50+
shippingTax: String,
51+
total: String,
52+
totalTax: String,
53+
paymentMethodTitle: String,
54+
items: [OrderItem],
55+
billingAddress: Address,
56+
shippingAddress: Address,
57+
coupons: [OrderCouponLine]) {
58+
59+
self.siteID = siteID
3760
self.orderID = orderID
3861
self.parentID = parentID
3962
self.customerID = customerID
@@ -65,7 +88,12 @@ public struct Order: Decodable {
6588
/// The public initializer for Order.
6689
///
6790
public init(from decoder: Decoder) throws {
91+
guard let siteID = decoder.userInfo[.siteID] as? Int else {
92+
throw OrderDecodingError.missingSiteID
93+
}
94+
6895
let container = try decoder.container(keyedBy: CodingKeys.self)
96+
6997
let orderID = try container.decode(Int.self, forKey: .orderID)
7098
let parentID = try container.decode(Int.self, forKey: .parentID)
7199
let customerID = try container.decode(Int.self, forKey: .customerID)
@@ -92,7 +120,7 @@ public struct Order: Decodable {
92120
let billingAddress = try container.decode(Address.self, forKey: .billingAddress)
93121
let coupons = try container.decode([OrderCouponLine].self, forKey: .couponLines)
94122

95-
self.init(orderID: orderID, parentID: parentID, customerID: customerID, number: number, status: status, currency: currency, customerNote: customerNote, dateCreated: dateCreated, dateModified: dateModified, datePaid: datePaid, discountTotal: discountTotal, discountTax: discountTax, shippingTotal: shippingTotal, shippingTax: shippingTax, total: total, totalTax: totalTax, paymentMethodTitle: paymentMethodTitle, items: items, billingAddress: billingAddress, shippingAddress: shippingAddress, coupons: coupons) // initialize the struct
123+
self.init(siteID: siteID, orderID: orderID, parentID: parentID, customerID: customerID, number: number, status: status, currency: currency, customerNote: customerNote, dateCreated: dateCreated, dateModified: dateModified, datePaid: datePaid, discountTotal: discountTotal, discountTax: discountTax, shippingTotal: shippingTotal, shippingTax: shippingTax, total: total, totalTax: totalTax, paymentMethodTitle: paymentMethodTitle, items: items, billingAddress: billingAddress, shippingAddress: shippingAddress, coupons: coupons) // initialize the struct
96124
}
97125
}
98126

@@ -135,7 +163,8 @@ private extension Order {
135163
//
136164
extension Order: Comparable {
137165
public static func == (lhs: Order, rhs: Order) -> Bool {
138-
return lhs.orderID == rhs.orderID &&
166+
return lhs.siteID == rhs.siteID &&
167+
lhs.orderID == rhs.orderID &&
139168
lhs.parentID == rhs.parentID &&
140169
lhs.customerID == rhs.customerID &&
141170
lhs.number == rhs.number &&
@@ -163,3 +192,10 @@ extension Order: Comparable {
163192
(lhs.orderID == rhs.orderID && lhs.dateCreated == rhs.dateCreated && lhs.dateModified < rhs.dateModified)
164193
}
165194
}
195+
196+
197+
// MARK: - Decoding Errors
198+
//
199+
enum OrderDecodingError: Error {
200+
case missingSiteID
201+
}

Networking/Networking/Model/OrderNote.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import Foundation
44
/// Represents an Order's Note Entity.
55
///
66
public struct OrderNote: Decodable {
7-
public let noteId: Int
7+
public let noteID: Int
88
public let dateCreated: Date
99
public let note: String
1010
public let isCustomerNote: Bool
1111

1212
/// OrderNote struct initializer.
1313
///
14-
init(noteId: Int, dateCreated: Date, note: String, isCustomerNote: Bool) {
15-
self.noteId = noteId
14+
public init(noteId: Int, dateCreated: Date, note: String, isCustomerNote: Bool) {
15+
self.noteID = noteId
1616
self.dateCreated = dateCreated
1717
self.note = note
1818
self.isCustomerNote = isCustomerNote
@@ -49,15 +49,15 @@ private extension OrderNote {
4949
//
5050
extension OrderNote: Comparable {
5151
public static func == (lhs: OrderNote, rhs: OrderNote) -> Bool {
52-
return lhs.noteId == rhs.noteId &&
52+
return lhs.noteID == rhs.noteID &&
5353
lhs.dateCreated == rhs.dateCreated &&
5454
lhs.note == rhs.note &&
5555
lhs.isCustomerNote == rhs.isCustomerNote
5656
}
5757

5858
public static func < (lhs: OrderNote, rhs: OrderNote) -> Bool {
59-
return lhs.noteId < rhs.noteId ||
60-
(lhs.noteId == rhs.noteId && lhs.dateCreated < rhs.dateCreated) ||
61-
(lhs.noteId == rhs.noteId && lhs.dateCreated == rhs.dateCreated && lhs.note < rhs.note)
59+
return lhs.noteID < rhs.noteID ||
60+
(lhs.noteID == rhs.noteID && lhs.dateCreated < rhs.dateCreated) ||
61+
(lhs.noteID == rhs.noteID && lhs.dateCreated == rhs.dateCreated && lhs.note < rhs.note)
6262
}
6363
}

Networking/Networking/Model/Site.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public struct Site: Decodable {
2121
///
2222
public let url: String
2323

24+
/// Indicates if there is a WooCommerce Store Active.
25+
///
26+
public let isWooCommerceActive: Bool
27+
2428
/// Indicates if this site hosts a WordPress Store.
2529
///
2630
public let isWordPressStore: Bool
@@ -38,16 +42,18 @@ public struct Site: Decodable {
3842

3943
let optionsContainer = try siteContainer.nestedContainer(keyedBy: OptionKeys.self, forKey: .options)
4044
isWordPressStore = try optionsContainer.decode(Bool.self, forKey: .isWordPressStore)
45+
isWooCommerceActive = try optionsContainer.decode(Bool.self, forKey: .isWooCommerceActive)
4146
}
4247

4348
/// Designated Initializer.
4449
///
45-
public init(siteID: Int, name: String, description: String, url: String, isWordPressStore: Bool) {
50+
public init(siteID: Int, name: String, description: String, url: String, isWooCommerceActive: Bool, isWordPressStore: Bool) {
4651
self.siteID = siteID
4752
self.name = name
4853
self.description = description
4954
self.url = url
5055
self.isWordPressStore = isWordPressStore
56+
self.isWooCommerceActive = isWooCommerceActive
5157
}
5258
}
5359

@@ -66,5 +72,6 @@ private extension Site {
6672

6773
enum OptionKeys: String, CodingKey {
6874
case isWordPressStore = "is_wpcom_store"
75+
case isWooCommerceActive = "woocommerce_is_active"
6976
}
7077
}

Networking/Networking/Remote/OrdersRemote.swift

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class OrdersRemote: Remote {
1717
let parameters = [ParameterKeys.page: String(page),
1818
ParameterKeys.perPage: String(Constants.defaultPageSize)]
1919
let request = JetpackRequest(wooApiVersion: .mark2, method: .get, siteID: siteID, path: path, parameters: parameters)
20-
let mapper = OrderListMapper()
20+
let mapper = OrderListMapper(siteID: siteID)
2121

2222
enqueue(request, mapper: mapper, completion: completion)
2323
}
@@ -32,7 +32,7 @@ public class OrdersRemote: Remote {
3232
public func loadOrder(for siteID: Int, orderID: Int, completion: @escaping (Order?, Error?) -> Void) {
3333
let path = "\(Constants.ordersPath)/\(orderID)"
3434
let request = JetpackRequest(wooApiVersion: .mark2, method: .get, siteID: siteID, path: path, parameters: nil)
35-
let mapper = OrderMapper()
35+
let mapper = OrderMapper(siteID: siteID)
3636

3737
enqueue(request, mapper: mapper, completion: completion)
3838
}
@@ -63,7 +63,27 @@ public class OrdersRemote: Remote {
6363
public func updateOrder(from siteID: Int, orderID: Int, status: String, completion: @escaping (Order?, Error?) -> Void) {
6464
let path = "\(Constants.ordersPath)/" + String(orderID)
6565
let parameters = [ParameterKeys.status: status]
66-
let mapper = OrderMapper()
66+
let mapper = OrderMapper(siteID: siteID)
67+
68+
let request = JetpackRequest(wooApiVersion: .mark2, method: .post, siteID: siteID, path: path, parameters: parameters)
69+
enqueue(request, mapper: mapper, completion: completion)
70+
}
71+
72+
/// Adds an order note to a specific Order.
73+
///
74+
/// - Parameters:
75+
/// - siteID: Site which hosts the Order.
76+
/// - orderID: Identifier of the Order to be updated.
77+
/// - isCustomerNote: if true, the note will be shown to customers and they will be notified.
78+
/// if false, the note will be for admin reference only. Default is false.
79+
/// - note: The note to be posted.
80+
/// - completion: Closure to be executed upon completion.
81+
///
82+
public func addOrderNote(for siteID: Int, orderID: Int, isCustomerNote: Bool, with note: String, completion: @escaping (OrderNote?, Error?) -> Void) {
83+
let path = "\(Constants.ordersPath)/" + String(orderID) + "/" + "\(Constants.notesPath)"
84+
let parameters = [ParameterKeys.note: note,
85+
ParameterKeys.customerNote: String(isCustomerNote)]
86+
let mapper = OrderNoteMapper()
6787

6888
let request = JetpackRequest(wooApiVersion: .mark2, method: .post, siteID: siteID, path: path, parameters: parameters)
6989
enqueue(request, mapper: mapper, completion: completion)
@@ -81,8 +101,10 @@ private extension OrdersRemote {
81101
}
82102

83103
enum ParameterKeys {
84-
static let status: String = "status"
85-
static let page: String = "page"
86-
static let perPage: String = "per_page"
104+
static let customerNote: String = "customer_note"
105+
static let note: String = "note"
106+
static let page: String = "page"
107+
static let perPage: String = "per_page"
108+
static let status: String = "status"
87109
}
88110
}

0 commit comments

Comments
 (0)