Skip to content

Commit c603980

Browse files
authored
Merge branch 'trunk' into issue/5878-enable-hub-menu-to-everyone
2 parents 8271154 + b60a2f9 commit c603980

File tree

24 files changed

+269
-151
lines changed

24 files changed

+269
-151
lines changed

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
2424
case .orderListFilters:
2525
return true
2626
case .jetpackConnectionPackageSupport:
27-
return buildConfig == .localDeveloper || buildConfig == .alpha
27+
return true
2828
case .orderCreation:
2929
return buildConfig == .localDeveloper || buildConfig == .alpha
3030
case .hubMenu:

Networking/Networking/Remote/StripeRemote.swift

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@ import Foundation
33
/// Stripe (Extension): Remote Endpoints
44
///
55
public class StripeRemote: Remote {
6-
/// Loads a card reader connection token for a given site ID and parses the response
7-
/// - Parameters:
8-
/// - siteID: Site for which we'll fetch the connection token.
9-
/// - completion: Closure to be executed upon completion.
10-
public func loadConnectionToken(for siteID: Int64,
11-
completion: @escaping(Result<ReaderConnectionToken, Error>) -> Void) {
12-
let request = JetpackRequest(wooApiVersion: .mark3, method: .post, siteID: siteID, path: Path.connectionTokens)
13-
14-
let mapper = ReaderConnectionTokenMapper()
15-
16-
enqueue(request, mapper: mapper, completion: completion)
17-
}
18-
196
/// Loads a Stripe account for a given site ID and parses the response
207
/// - Parameters:
218
/// - siteID: Site for which we'll fetch the Stripe account info.
@@ -75,6 +62,23 @@ public class StripeRemote: Remote {
7562

7663
enqueue(request, mapper: mapper, completion: completion)
7764
}
65+
}
66+
67+
// MARK: - CardReaderCapableRemote
68+
//
69+
extension StripeRemote {
70+
/// Loads a card reader connection token for a given site ID and parses the response
71+
/// - Parameters:
72+
/// - siteID: Site for which we'll fetch the connection token.
73+
/// - completion: Closure to be executed upon completion.
74+
public func loadConnectionToken(for siteID: Int64,
75+
completion: @escaping(Result<ReaderConnectionToken, Error>) -> Void) {
76+
let request = JetpackRequest(wooApiVersion: .mark3, method: .post, siteID: siteID, path: Path.connectionTokens)
77+
78+
let mapper = ReaderConnectionTokenMapper()
79+
80+
enqueue(request, mapper: mapper, completion: completion)
81+
}
7882

7983
/// Load the store's location for use as a default location for a card reader
8084
/// The backend coordinates this with Stripe to return a proper Stripe Location object ID

Networking/Networking/Remote/WCPayRemote.swift

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@ import Foundation
33
/// WCPay: Remote Endpoints
44
///
55
public class WCPayRemote: Remote {
6-
/// Loads a card reader connection token for a given site ID and parses the response
7-
/// - Parameters:
8-
/// - siteID: Site for which we'll fetch the connection token.
9-
/// - completion: Closure to be executed upon completion.
10-
public func loadConnectionToken(for siteID: Int64,
11-
completion: @escaping(Result<ReaderConnectionToken, Error>) -> Void) {
12-
let request = JetpackRequest(wooApiVersion: .mark3, method: .post, siteID: siteID, path: Path.connectionTokens)
13-
14-
let mapper = ReaderConnectionTokenMapper()
15-
16-
enqueue(request, mapper: mapper, completion: completion)
17-
}
18-
196
/// Loads a WCPay account for a given site ID and parses the response
207
/// - Parameters:
218
/// - siteID: Site for which we'll fetch the WCPay account info.
@@ -73,6 +60,23 @@ public class WCPayRemote: Remote {
7360

7461
enqueue(request, mapper: mapper, completion: completion)
7562
}
63+
}
64+
65+
// MARK: - CardReaderCapableRemote
66+
//
67+
extension WCPayRemote {
68+
/// Loads a card reader connection token for a given site ID and parses the response
69+
/// - Parameters:
70+
/// - siteID: Site for which we'll fetch the connection token.
71+
/// - completion: Closure to be executed upon completion.
72+
public func loadConnectionToken(for siteID: Int64,
73+
completion: @escaping(Result<ReaderConnectionToken, Error>) -> Void) {
74+
let request = JetpackRequest(wooApiVersion: .mark3, method: .post, siteID: siteID, path: Path.connectionTokens)
75+
76+
let mapper = ReaderConnectionTokenMapper()
77+
78+
enqueue(request, mapper: mapper, completion: completion)
79+
}
7680

7781
/// Load the store's location for use as a default location for a card reader
7882
/// The backend (since WCPay plugin 3.0.0) coordinates this with Stripe to return a proper Stripe Location object ID

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
-----
55
- [***] In-Person Payments: Support for Stripe M2 card reader. [https://github.com/woocommerce/woocommerce-ios/pull/5844]
66
- [***] We introduced a new tab called "Menu", a tab in the main navigation where you can browser different sub-sections of the app: Switch Store, Settings, WooCommerce Admin, View Store and Reviews. [https://github.com/woocommerce/woocommerce-ios/pull/5926]
7+
- [***] Store admins can now access sites with plugins that have Jetpack Connection Package (e.g. WooCommerce Payments, Jetpack Backup) in the app. These sites do not require Jetpack-the-plugin to connect anymore. Store admins can still install Jetpack-the-plugin from the app through settings or a Jetpack banner. [https://github.com/woocommerce/woocommerce-ios/pull/5924]
78
- [*] Add/Edit Product screen: Fix transient product name while adding images.[https://github.com/woocommerce/woocommerce-ios/pull/5840]
89

910
8.3

WooCommerce/Classes/ViewRelated/Dashboard/Settings/In-Person Payments/CardPresentPaymentsOnboardingUseCase.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ private extension CardPresentPaymentsOnboardingUseCase {
221221
return .genericError
222222
}
223223

224+
// If we've gotten this far, tell the Card Present Payment Store which backend to use
225+
let setAccount = CardPresentPaymentAction.use(paymentGatewayAccount: account)
226+
ServiceLocator.stores.dispatch(setAccount)
227+
224228
return .completed
225229
}
226230
}

WooCommerce/UITestsFoundation/Screens/Orders/SingleOrderScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public final class SingleOrderScreen: ScreenObject {
2121
// Expects 2 instances of order.number - one in Header and one in Summary
2222
app.assertTextVisibilityCount(textToFind: "#\(order.number)", expectedCount: 2)
2323

24+
// Expects 2 instances of first_name - one in Summary and one in Shipping details
2425
app.assertTextVisibilityCount(textToFind: order.billing.first_name, expectedCount: 2)
2526
app.assertElement(matching: "summary-table-view-cell", existsOnCellWithIdentifier: "\(order.billing.first_name) \(order.billing.last_name)")
2627

27-
// Loops through all products on the order
2828
for product in order.line_items {
2929
XCTAssertTrue(app.staticTexts[product.name].isFullyVisibleOnScreen(), "'\(product.name)' is missing!")
3030
}

WooCommerce/WooCommerceScreenshots/WooCommerceScreenshots.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class WooCommerceScreenshots: XCTestCase {
4949
.cancel()
5050

5151
// Reviews
52-
.tabBar.goToReviewsScreen()
52+
.tabBar.goToMenuScreen()
53+
.goToReviewsScreen()
5354
.thenTakeScreenshot(named: "review-list")
5455
.selectReview(atIndex: 3)
5556
.thenTakeScreenshot(named: "review-details")

WooCommerce/WooCommerceTests/Tools/MockOrders.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ final class MockOrders {
4242
items: [OrderItem] = [],
4343
shippingLines: [ShippingLine] = sampleShippingLines(),
4444
refunds: [OrderRefundCondensed] = [],
45-
fees: [OrderFeeLine] = []) -> Order {
45+
fees: [OrderFeeLine] = [],
46+
taxes: [OrderTaxLine] = []) -> Order {
4647
return Order(siteID: siteID,
4748
orderID: orderID,
4849
parentID: 0,
@@ -70,8 +71,7 @@ final class MockOrders {
7071
coupons: [],
7172
refunds: refunds,
7273
fees: fees,
73-
taxes: [] // TODO: 5809 - Add sampleOrderTaxLines method
74-
)
74+
taxes: taxes)
7575
}
7676

7777
func sampleOrder() -> Order {
@@ -118,8 +118,7 @@ final class MockOrders {
118118
coupons: [],
119119
refunds: [],
120120
fees: [],
121-
taxes: [] // TODO: 5809 - Add sampleOrderTaxLines method
122-
)
121+
taxes: [])
123122
}
124123

125124
static func sampleShippingLines(cost: String = "133.00", tax: String = "0.00") -> [ShippingLine] {

WooCommerce/WooCommerceUITests/Tests/OrdersTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ final class OrdersTests: XCTestCase {
1616
func testOrdersScreenLoads() throws {
1717
let orders = try GetMocks.readOrdersData()
1818

19-
try TabNavComponent()
20-
.goToOrdersScreen()
19+
try TabNavComponent().goToOrdersScreen()
2120
.verifyOrdersScreenLoaded()
2221
.verifyOrdersList(orders: orders)
2322
.selectOrder(byOrderNumber: orders[0].number)

WooCommerce/WooCommerceUITests/Tests/ProductsTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ final class ProductsTests: XCTestCase {
1010
app.launchArguments = ["logout-at-launch", "disable-animations", "mocked-wpcom-api", "-ui_testing"]
1111
app.launch()
1212
try LoginFlow.logInWithWPcom()
13-
try TabNavComponent().goToProductsScreen()
1413
}
1514

1615
func testProductsScreenLoad() throws {
1716
let products = try GetMocks.readProductsData()
1817

19-
try ProductsScreen()
18+
try TabNavComponent().goToProductsScreen()
2019
.verifyProductsScreenLoaded()
2120
.verifyProductList(products: products)
2221
.selectProduct(byName: products[0].name)

0 commit comments

Comments
 (0)