Skip to content

Commit 1a11ed7

Browse files
authored
Merge branch 'trunk' into woomob-660-ios-26-exc_breakpoint-signalcompressionsignalencoderswift261
2 parents 157cfc8 + dc9cf5c commit 1a11ed7

File tree

17 files changed

+579
-322
lines changed

17 files changed

+579
-322
lines changed

Modules/Sources/Hardware/CardReader/CurrencyCode.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ public struct CurrencyCode {
1616

1717
public var wrappedValue: String {
1818
get {
19-
guard Locale.isoCurrencyCodes.map({ $0.uppercased() }).contains(value.uppercased()) else {
19+
guard Locale.Currency.isoCurrencies.map({ $0.identifier.uppercased() }).contains(value.uppercased()) else {
2020
return ""
2121
}
22-
2322
return value.lowercased()
2423
}
2524
set {

Modules/Sources/Hardware/CardReader/StripeCardReader/PaymentMethod+Stripe.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extension PaymentMethod {
2424
return
2525
}
2626
self = .interacPresent(details: CardPresentTransactionDetails(details: details))
27-
case .unknown:
27+
case .affirm, .wechatPay, .unknown:
2828
self = .unknown
2929
@unknown default:
3030
self = .unknown

Modules/Sources/Networking/Mapper/JetpackConnectionProvisionMapper.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ public struct JetpackConnectionProvisionResponse: Decodable {
1818
public let userId: Int64
1919
public let scope: String
2020
public let secret: String
21+
22+
/// periphery: ignore - used in test module
23+
public init(userId: Int64, scope: String, secret: String) {
24+
self.userId = userId
25+
self.scope = scope
26+
self.secret = secret
27+
}
2128
}

Modules/Sources/Yosemite/Stores/JustInTimeMessageStore.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ private extension JustInTimeMessageStore {
104104
}
105105

106106
func localeLanguageRegionIdentifier() -> String? {
107-
guard let languageCode = Locale.current.languageCode else {
107+
guard let languageCode = Locale.current.language.languageCode?.identifier else {
108108
return nil
109109
}
110-
guard let regionCode = Locale.current.regionCode else {
110+
guard let regionCode = Locale.current.region?.identifier else {
111111
return languageCode
112112
}
113113
return "\(languageCode)_\(regionCode)"

RELEASE-NOTES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
23.1
55
-----
6-
6+
- [*] Jetpack setup: Native experience for the connection step [https://github.com/woocommerce/woocommerce-ios/pull/15983]
7+
- [*] Payments: Updated the In-Person Payments `Learn More` redirection to display the correct page based on the selected payment provider [https://github.com/woocommerce/woocommerce-ios/pull/15998]
78

89
23.0
910
-----

WooCommerce/Classes/Authentication/Jetpack Setup/LoginJetpackSetupCoordinator.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ final class LoginJetpackSetupCoordinator: Coordinator {
4444
//
4545
private extension LoginJetpackSetupCoordinator {
4646
func showSetupSteps() {
47-
let setupUI = JetpackSetupHostingController(siteURL: siteURL, connectionOnly: connectionOnly, onStoreNavigation: { [weak self] connectedEmail in
47+
let setupUI = JetpackSetupHostingController(
48+
siteURL: siteURL,
49+
connectionOnly: connectionOnly,
50+
wpcomCredentials: stores.sessionManager.defaultCredentials,
51+
onStoreNavigation: { [weak self] connectedEmail in
4852
guard let self, let email = connectedEmail else { return }
4953
if email != self.stores.sessionManager.defaultAccount?.email {
5054
// if the user authorized Jetpack with a different account, support them to log in with that account.

WooCommerce/Classes/Authentication/Jetpack Setup/Native Jetpack Setup/JetpackSetupView.swift

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@ import protocol WooFoundation.Analytics
77
final class JetpackSetupHostingController: UIHostingController<JetpackSetupView> {
88
private let viewModel: JetpackSetupViewModel
99
private let authentication: Authentication
10-
private let connectionWebViewCredentials: Credentials?
10+
private let wpcomCredentials: Credentials?
1111

1212
init(siteURL: String,
1313
connectionOnly: Bool,
14-
connectionWebViewCredentials: Credentials? = nil,
14+
wpcomCredentials: Credentials?,
1515
stores: StoresManager = ServiceLocator.stores,
1616
authentication: Authentication = ServiceLocator.authenticationManager,
1717
analytics: Analytics = ServiceLocator.analytics,
1818
onStoreNavigation: @escaping (String?) -> Void) {
1919
self.viewModel = JetpackSetupViewModel(siteURL: siteURL,
2020
connectionOnly: connectionOnly,
21+
wpcomCredentials: wpcomCredentials,
2122
stores: stores,
2223
analytics: analytics,
2324
onStoreNavigation: onStoreNavigation)
2425
self.authentication = authentication
25-
self.connectionWebViewCredentials = connectionWebViewCredentials
26+
self.wpcomCredentials = wpcomCredentials
2627
super.init(rootView: JetpackSetupView(viewModel: viewModel))
2728

2829
rootView.webViewPresentationHandler = { [weak self] in
@@ -92,7 +93,7 @@ final class JetpackSetupHostingController: UIHostingController<JetpackSetupView>
9293
guard let self else { return }
9394
self.viewModel.jetpackConnectionInterrupted = true
9495
})
95-
let webView = AuthenticatedWebViewController(viewModel: webViewModel, extraCredentials: connectionWebViewCredentials)
96+
let webView = AuthenticatedWebViewController(viewModel: webViewModel, extraCredentials: wpcomCredentials)
9697
webView.navigationItem.leftBarButtonItem = UIBarButtonItem(title: Localization.cancel,
9798
style: .plain,
9899
target: self,
@@ -327,10 +328,3 @@ private extension JetpackSetupView {
327328
static let interruptedConnectionActionHandlerDelayTime: Double = 0.3
328329
}
329330
}
330-
331-
struct JetpackSetupView_Previews: PreviewProvider {
332-
static var previews: some View {
333-
JetpackSetupView(viewModel: JetpackSetupViewModel(siteURL: "https://test.com", connectionOnly: true))
334-
JetpackSetupView(viewModel: JetpackSetupViewModel(siteURL: "https://test.com", connectionOnly: false))
335-
}
336-
}

0 commit comments

Comments
 (0)