Skip to content

Commit 11050d6

Browse files
committed
Merge branch 'trunk' into issue/6523-rename-protocol-and-instance
# Conflicts: # WooCommerce/Classes/ViewRelated/Reviews/ReviewsDataSource.swift
2 parents 210e94c + 80503f0 commit 11050d6

File tree

105 files changed

+3061
-1045
lines changed

Some content is hidden

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

105 files changed

+3061
-1045
lines changed

Fakes/Fakes/Networking.generated.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ extension Order {
337337
totalTax: .fake(),
338338
paymentMethodID: .fake(),
339339
paymentMethodTitle: .fake(),
340+
paymentURL: .fake(),
340341
chargeID: .fake(),
341342
items: .fake(),
342343
billingAddress: .fake(),

Gemfile.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ GEM
1616
artifactory (3.0.15)
1717
atomos (0.1.3)
1818
aws-eventstream (1.2.0)
19-
aws-partitions (1.553.0)
20-
aws-sdk-core (3.126.0)
19+
aws-partitions (1.573.0)
20+
aws-sdk-core (3.130.0)
2121
aws-eventstream (~> 1, >= 1.0.2)
2222
aws-partitions (~> 1, >= 1.525.0)
2323
aws-sigv4 (~> 1.1)
2424
jmespath (~> 1.0)
25-
aws-sdk-kms (1.54.0)
26-
aws-sdk-core (~> 3, >= 3.126.0)
25+
aws-sdk-kms (1.55.0)
26+
aws-sdk-core (~> 3, >= 3.127.0)
2727
aws-sigv4 (~> 1.1)
28-
aws-sdk-s3 (1.112.0)
29-
aws-sdk-core (~> 3, >= 3.126.0)
28+
aws-sdk-s3 (1.113.0)
29+
aws-sdk-core (~> 3, >= 3.127.0)
3030
aws-sdk-kms (~> 1)
3131
aws-sigv4 (~> 1.4)
3232
aws-sigv4 (1.4.0)
@@ -93,7 +93,7 @@ GEM
9393
escape (0.0.4)
9494
ethon (0.15.0)
9595
ffi (>= 1.15.0)
96-
excon (0.91.0)
96+
excon (0.92.2)
9797
faraday (1.10.0)
9898
faraday-em_http (~> 1.0)
9999
faraday-em_synchrony (~> 1.0)
@@ -123,7 +123,7 @@ GEM
123123
faraday_middleware (1.2.0)
124124
faraday (~> 1.0)
125125
fastimage (2.2.6)
126-
fastlane (2.204.2)
126+
fastlane (2.205.1)
127127
CFPropertyList (>= 2.3, < 4.0.0)
128128
addressable (>= 2.8, < 3.0.0)
129129
artifactory (~> 3.0)
@@ -184,7 +184,7 @@ GEM
184184
gh_inspector (1.1.3)
185185
git (1.10.2)
186186
rchardet (~> 1.8)
187-
google-apis-androidpublisher_v3 (0.16.0)
187+
google-apis-androidpublisher_v3 (0.18.0)
188188
google-apis-core (>= 0.4, < 2.a)
189189
google-apis-core (0.4.2)
190190
addressable (~> 2.5, >= 2.5.1)
@@ -199,24 +199,24 @@ GEM
199199
google-apis-core (>= 0.4, < 2.a)
200200
google-apis-playcustomapp_v1 (0.7.0)
201201
google-apis-core (>= 0.4, < 2.a)
202-
google-apis-storage_v1 (0.11.0)
202+
google-apis-storage_v1 (0.12.0)
203203
google-apis-core (>= 0.4, < 2.a)
204204
google-cloud-core (1.6.0)
205205
google-cloud-env (~> 1.0)
206206
google-cloud-errors (~> 1.0)
207-
google-cloud-env (1.5.0)
208-
faraday (>= 0.17.3, < 2.0)
207+
google-cloud-env (1.6.0)
208+
faraday (>= 0.17.3, < 3.0)
209209
google-cloud-errors (1.2.0)
210-
google-cloud-storage (1.36.0)
210+
google-cloud-storage (1.36.1)
211211
addressable (~> 2.8)
212212
digest-crc (~> 0.4)
213213
google-apis-iamcredentials_v1 (~> 0.1)
214214
google-apis-storage_v1 (~> 0.1)
215215
google-cloud-core (~> 1.6)
216216
googleauth (>= 0.16.2, < 2.a)
217217
mini_mime (~> 1.0)
218-
googleauth (1.1.0)
219-
faraday (>= 0.17.3, < 2.0)
218+
googleauth (1.1.2)
219+
faraday (>= 0.17.3, < 3.a)
220220
jwt (>= 1.4, < 3.0)
221221
memoist (~> 0.16)
222222
multi_json (~> 1.11)
@@ -228,7 +228,7 @@ GEM
228228
httpclient (2.8.3)
229229
i18n (1.10.0)
230230
concurrent-ruby (~> 1.0)
231-
jmespath (1.5.0)
231+
jmespath (1.6.1)
232232
json (2.6.1)
233233
jsonlint (0.3.0)
234234
oj (~> 3)
@@ -285,9 +285,9 @@ GEM
285285
addressable (>= 2.3.5)
286286
faraday (> 0.8, < 2.0)
287287
security (0.1.3)
288-
signet (0.16.0)
288+
signet (0.16.1)
289289
addressable (~> 2.8)
290-
faraday (>= 0.17.3, < 2.0)
290+
faraday (>= 0.17.5, < 3.0)
291291
jwt (>= 1.5, < 3.0)
292292
multi_json (~> 1.10)
293293
simctl (1.6.8)
@@ -309,7 +309,7 @@ GEM
309309
uber (0.1.0)
310310
unf (0.1.4)
311311
unf_ext
312-
unf_ext (0.0.8)
312+
unf_ext (0.0.8.1)
313313
unicode-display_width (1.8.0)
314314
webrick (1.7.0)
315315
word_wrap (1.0.0)

Hardware/Hardware/CardReader/StripeCardReader/StripeCardReaderService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ extension StripeCardReaderService {
563563
}
564564
promise(.success(()))
565565
})
566-
//TODO: handle timeout?
566+
//TODO: 5983 - handle timeout when called from retry after refund failure
567567
}.eraseToAnyPublisher()
568568
}
569569
}

Networking/Networking.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
2665032E261F4FBF0079A159 /* ProductAddOnOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2665032D261F4FBF0079A159 /* ProductAddOnOption.swift */; };
143143
26650332261FFA1A0079A159 /* ProductAddOnEnvelope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26650331261FFA1A0079A159 /* ProductAddOnEnvelope.swift */; };
144144
266C7F9225AD3C88006ED243 /* attribute-term.json in Resources */ = {isa = PBXBuildFile; fileRef = 266C7F9125AD3C87006ED243 /* attribute-term.json */; };
145-
267066092774BF3B008E1F68 /* settings-advanced.json in Resources */ = {isa = PBXBuildFile; fileRef = 267066082774BF3B008E1F68 /* settings-advanced.json */; };
146145
2670C3FC270F4E06002FE931 /* SiteListMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2670C3FB270F4E06002FE931 /* SiteListMapperTests.swift */; };
147146
2670C3FE270F4E6A002FE931 /* sites-malformed.json in Resources */ = {isa = PBXBuildFile; fileRef = 2670C3FD270F4E6A002FE931 /* sites-malformed.json */; };
148147
267313312559CC930026F7EF /* PaymentGateway.swift in Sources */ = {isa = PBXBuildFile; fileRef = 267313302559CC930026F7EF /* PaymentGateway.swift */; };
@@ -812,7 +811,6 @@
812811
2665032D261F4FBF0079A159 /* ProductAddOnOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAddOnOption.swift; sourceTree = "<group>"; };
813812
26650331261FFA1A0079A159 /* ProductAddOnEnvelope.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAddOnEnvelope.swift; sourceTree = "<group>"; };
814813
266C7F9125AD3C87006ED243 /* attribute-term.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "attribute-term.json"; sourceTree = "<group>"; };
815-
267066082774BF3B008E1F68 /* settings-advanced.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "settings-advanced.json"; sourceTree = "<group>"; };
816814
2670C3FB270F4E06002FE931 /* SiteListMapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteListMapperTests.swift; sourceTree = "<group>"; };
817815
2670C3FD270F4E6A002FE931 /* sites-malformed.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "sites-malformed.json"; sourceTree = "<group>"; };
818816
267313302559CC930026F7EF /* PaymentGateway.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentGateway.swift; sourceTree = "<group>"; };
@@ -1942,7 +1940,6 @@
19421940
D88D5A40230BC5DA007B6E01 /* reviews-all.json */,
19431941
57BE08D72409B63700F6DCED /* reviews-missing-avatar-urls.json */,
19441942
D88D5A42230BC668007B6E01 /* reviews-single.json */,
1945-
267066082774BF3B008E1F68 /* settings-advanced.json */,
19461943
DE74F29B27E0A1D00002FE59 /* setting-coupon.json */,
19471944
DE74F29F27E3137F0002FE59 /* setting-analytics.json */,
19481945
74046E20217A73D0007DD7BF /* settings-general.json */,
@@ -2519,7 +2516,6 @@
25192516
CC0786C7267BB10700BA9AC1 /* shipping-label-status-success.json in Resources */,
25202517
D88D5A41230BC5DA007B6E01 /* reviews-all.json in Resources */,
25212518
74C947862193A6C70024CB60 /* comment-moderate-unapproved.json in Resources */,
2522-
267066092774BF3B008E1F68 /* settings-advanced.json in Resources */,
25232519
3105472C262E303400C5C02B /* wcpay-payment-intent-unknown-status.json in Resources */,
25242520
B559EBAA20A0B5CD00836CD4 /* orders-load-all.json in Resources */,
25252521
3158A4A12729F40F00C3CFA8 /* wcpay-account-live-test.json in Resources */,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ extension Order {
257257
totalTax: CopiableProp<String> = .copy,
258258
paymentMethodID: CopiableProp<String> = .copy,
259259
paymentMethodTitle: CopiableProp<String> = .copy,
260+
paymentURL: NullableCopiableProp<URL> = .copy,
260261
chargeID: NullableCopiableProp<String> = .copy,
261262
items: CopiableProp<[OrderItem]> = .copy,
262263
billingAddress: NullableCopiableProp<Address> = .copy,
@@ -287,6 +288,7 @@ extension Order {
287288
let totalTax = totalTax ?? self.totalTax
288289
let paymentMethodID = paymentMethodID ?? self.paymentMethodID
289290
let paymentMethodTitle = paymentMethodTitle ?? self.paymentMethodTitle
291+
let paymentURL = paymentURL ?? self.paymentURL
290292
let chargeID = chargeID ?? self.chargeID
291293
let items = items ?? self.items
292294
let billingAddress = billingAddress ?? self.billingAddress
@@ -318,6 +320,7 @@ extension Order {
318320
totalTax: totalTax,
319321
paymentMethodID: paymentMethodID,
320322
paymentMethodTitle: paymentMethodTitle,
323+
paymentURL: paymentURL,
321324
chargeID: chargeID,
322325
items: items,
323326
billingAddress: billingAddress,

Networking/Networking/Model/Order.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public struct Order: Decodable, GeneratedCopiable, GeneratedFakeable {
3131
public let totalTax: String
3232
public let paymentMethodID: String
3333
public let paymentMethodTitle: String
34+
public let paymentURL: URL?
3435
public let chargeID: String?
3536

3637
public let items: [OrderItem]
@@ -64,6 +65,7 @@ public struct Order: Decodable, GeneratedCopiable, GeneratedFakeable {
6465
totalTax: String,
6566
paymentMethodID: String,
6667
paymentMethodTitle: String,
68+
paymentURL: URL?,
6769
chargeID: String?,
6870
items: [OrderItem]?,
6971
billingAddress: Address?,
@@ -97,6 +99,7 @@ public struct Order: Decodable, GeneratedCopiable, GeneratedFakeable {
9799
self.totalTax = totalTax
98100
self.paymentMethodID = paymentMethodID
99101
self.paymentMethodTitle = paymentMethodTitle
102+
self.paymentURL = paymentURL
100103
self.chargeID = chargeID
101104

102105
self.items = items ?? []
@@ -143,6 +146,9 @@ public struct Order: Decodable, GeneratedCopiable, GeneratedFakeable {
143146
let paymentMethodID = try container.decode(String.self, forKey: .paymentMethodID)
144147
let paymentMethodTitle = try container.decode(String.self, forKey: .paymentMethodTitle)
145148

149+
// "payment_url" is only available on stores stores with version >= 6.4
150+
let paymentURL = try container.decodeIfPresent(URL.self, forKey: .paymentURL)
151+
146152
let allOrderMetaData = try? container.decode([OrderMetaData].self, forKey: .metadata)
147153
var chargeID: String? = nil
148154
chargeID = allOrderMetaData?.first(where: { $0.key == "_charge_id" })?.value
@@ -192,6 +198,7 @@ public struct Order: Decodable, GeneratedCopiable, GeneratedFakeable {
192198
totalTax: totalTax,
193199
paymentMethodID: paymentMethodID,
194200
paymentMethodTitle: paymentMethodTitle,
201+
paymentURL: paymentURL,
195202
chargeID: chargeID,
196203
items: items,
197204
billingAddress: billingAddress,
@@ -224,6 +231,7 @@ public struct Order: Decodable, GeneratedCopiable, GeneratedFakeable {
224231
totalTax: "",
225232
paymentMethodID: "",
226233
paymentMethodTitle: "",
234+
paymentURL: nil,
227235
chargeID: nil,
228236
items: [],
229237
billingAddress: nil,
@@ -264,6 +272,7 @@ internal extension Order {
264272
case totalTax = "total_tax"
265273
case paymentMethodID = "payment_method"
266274
case paymentMethodTitle = "payment_method_title"
275+
case paymentURL = "payment_url"
267276

268277
case items = "line_items"
269278
case shippingAddress = "shipping"
@@ -301,6 +310,7 @@ extension Order: Equatable {
301310
lhs.totalTax == rhs.totalTax &&
302311
lhs.paymentMethodID == rhs.paymentMethodID &&
303312
lhs.paymentMethodTitle == rhs.paymentMethodTitle &&
313+
lhs.paymentURL == rhs.paymentURL &&
304314
lhs.billingAddress == rhs.billingAddress &&
305315
lhs.shippingAddress == rhs.shippingAddress &&
306316
lhs.shippingLines.count == rhs.shippingLines.count &&

Networking/Networking/Remote/SiteSettingsRemote.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@ public class SiteSettingsRemote: Remote {
3333
enqueue(request, mapper: mapper, completion: completion)
3434
}
3535

36-
/// Retrieves all of the advanced `SiteSetting`s for a given site.
37-
///
38-
/// - Parameters:
39-
/// - siteID: Site for which we'll fetch the advanced settings.
40-
/// - completion: Closure to be executed upon completion.
41-
///
42-
public func loadAdvancedSettings(for siteID: Int64, completion: @escaping (Result<[SiteSetting], Error>) -> Void) {
43-
let path = Constants.siteSettingsPath + Constants.advancedSettingsGroup
44-
let request = JetpackRequest(wooApiVersion: .mark3, method: .get, siteID: siteID, path: path, parameters: nil)
45-
let mapper = SiteSettingsMapper(siteID: siteID, settingsGroup: SiteSettingGroup.advanced)
46-
47-
enqueue(request, mapper: mapper, completion: completion)
48-
}
49-
5036
/// Retrieve detail for a single setting for a given site
5137
///
5238
/// - Parameters:

Networking/NetworkingTests/Mapper/OrderMapperTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ final class OrderMapperTests: XCTestCase {
4040
XCTAssertEqual(order.shippingTax, "0.00")
4141
XCTAssertEqual(order.total, "31.20")
4242
XCTAssertEqual(order.totalTax, "1.20")
43+
XCTAssertEqual(order.paymentURL, URL(string: "http://www.automattic.com"))
4344
}
4445

4546
/// Verifies that all of the Order Address fields are parsed correctly.

Networking/NetworkingTests/Remote/SiteSettingsRemoteTests.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,6 @@ final class SiteSettingsRemoteTests: XCTestCase {
8787
wait(for: [expectation], timeout: Constants.expectationTimeout)
8888
}
8989

90-
// MARK: - Load advanced settings tests
91-
92-
func test_load_advanced_settings_properly_returns_parsed_settings() throws {
93-
// Given
94-
network.simulateResponse(requestUrlSuffix: "settings/advanced", filename: "settings-advanced")
95-
let remote = SiteSettingsRemote(network: network)
96-
97-
// When
98-
let result: Result<[Networking.SiteSetting], Error> = waitFor { promise in
99-
remote.loadAdvancedSettings(for: self.sampleSiteID) { result in
100-
promise(result)
101-
}
102-
}
103-
104-
// Then
105-
let settings = try result.get()
106-
XCTAssertEqual(settings.count, 2)
107-
}
108-
10990
// MARK: - Load single setting tests
11091
func test_loadSetting_properly_returns_parsed_settings() throws {
11192
// Given

Networking/NetworkingTests/Responses/order.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
],
101101
"payment_method": "stripe",
102102
"payment_method_title": "Credit Card (Stripe)",
103+
"payment_url": "http://www.automattic.com",
103104
"date_paid_gmt": "2018-04-03T23:05:14",
104105
"date_completed_gmt": null,
105106
"line_items": [

0 commit comments

Comments
 (0)