-
Notifications
You must be signed in to change notification settings - Fork 120
[Woo POS][Settings] i2: Payments onboarding flow through POS settings #16293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Woo POS][Settings] i2: Payments onboarding flow through POS settings #16293
Conversation
…ving cardPresentPaymentOnboardingViewContainer value
|
|
joshheald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected. Another one to put in that view modifier, if it works!
| func paymentsOnboardingView(from onboardingViewContainer: CardPresentPaymentOnboardingViewContainer) -> some View { | ||
| onboardingViewContainer.configuration.showSupport = { | ||
| posModel.cancelCardPaymentsOnboarding() | ||
| showSupport = true | ||
| } | ||
|
|
||
| return PointOfSaleCardPresentPaymentOnboardingView( | ||
| viewModel: .init(onboardingViewContainer: onboardingViewContainer, | ||
| onDismissTap: { | ||
| posModel.cancelCardPaymentsOnboarding() | ||
| })) | ||
| .onAppear { | ||
| posModel.trackCardPaymentsOnboardingShown() | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is all duplicative as well, could you take a look at including it in the cardReaderConnecting modifier when you look at that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely, tracking it on WOOMOB-1621 👯

Closes WOOMOB-1610
Description
This PR adds the payments onboarding modal flow through POS settings. For this we copy the existing implementation held in
PointOfSaleDashboardView.I'll attempt to reduce the code duplication from both onboarding and card connection in the next PR, some of it is a bit tricky.
Changes
.posModalto the hardware detail view to handle onboarding presentation..posSheetto the hardware detail view to handle support webview presentation from onboarding.Test Steps
.stripeAccountOverdueRequirement(plugin: .wcPay)inCardPresentPaymentsOnboardingUseCase.checkOnboardingStateConnect card readerdismiss,refresh,resolve now, orcontact usworks normally.pos_decorator:Not necessary to test the full flow, but just for completeness sake: Testing the onboarding is a bit annoying, as is called multiple times through the app lifecycle, the "easier way I found to sort of test from incomplete onboarding to success connection is to add a flag to
CardPresentPaymentsOnboardingUseCaseand wrapcheckOnboardingState():final class CardPresentPaymentsOnboardingUseCase: CardPresentPaymentsOnboardingUseCaseProtocol, ObservableObject { + private var foo: Bool = true func checkOnboardingState() -> CardPresentPaymentOnboardingState { + if foo { + return .stripeAccountOverdueRequirement(plugin: .wcPay) + } }Add a breakpoint before
fooand disable it, navigate to POS Settings, re-enable the breakpoint and once triggers update the value viaexpression foo = falsewhich would bypass the it and continue the normal onboarding flow.Screenshots
Onboarding flow
Screen.Recording.2025-10-30.at.15.55.45.mov
From incomplete onboarding to card reader connection
_from.onboarding.to.connection.MP4