woocommerce-ios
woocommerce-ios copied to clipboard
[Mobile Payments] Onboarding is run for every payment when a reader is connected
Description
While working on #7504, I noticed that we run the IPP Onboarding flow every time we tap Card on the Payment Method selection screen.
Onboarding flows are only required for connecting a reader. Checking onboarding status too frequently will result in unnecessary API requests and data usage, and a nuisance to the merchant when skippable steps such as Pending Requirements are shown for every payment.
This is likely to be the reason for higher levels of onboarding Tracks events on iOS compared to Android.
We should prevent the onboarding checks while there is already a reader connected.
Hi @joshheald! I try to reproduce this one and I couldn't. As I see, we have this flow:
With one reader connected:
PaymentMethodsViewModel -> CardPresentPaymentsOnboardingPresenting
CardPresentPaymentsOnboardingPresenting -> CardPresentPaymentsReadinessUseCase CardPresentPaymentsReadinessUseCase.checkCardPaymentReadiness returns .ready if there's a reader connected, thus preventing CardPresentPaymentsOnboardingPresenterfrom triggering the onboarding.
I also looked for events being tracked in the Xcode console, but nothing related to onboarding appeared. Am I missing something here? Could you add more information? Thanks a lot!