woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

[Mobile Payments] Run onboarding check on the IPP hub screen asynchronously

Open toupper opened this issue 1 year ago • 1 comments

Closes: #7362

Description

With this PR we run the onboarding asynchronously when we open the Payments Menu from the Menu Hub. This ensures that the user is ready to take card payments, and enables/disables/shows/hides the relevant rows (See test cases).

We reuse the existing InPersonPaymentsMenuViewController class, making optional those fields that we don't need. The new functionality is hidden behind the feature flag so it is not displayed when the latter is disabled.

Testing instructions

Happy case: The user has the onboarding finished

  • Prerequisites: Finish the card present onboarding.
  1. Go to Menu
  2. Tap on Payments
  3. The IPP Menu should be shown. The activity indicator loads. The Manage card reader row is enabled after the onboarding finishes:

https://user-images.githubusercontent.com/1864060/183947326-6d75ef8f-be5e-4fc5-9146-f1b6a56e882a.mp4

Onboarding finished but WCPay and Stripe plugins are installed and active

  • Prerequisites: The card present onboarding is finished but WCPay and Stripe plugins are installed and active.
  1. Go to Menu
  2. Tap on Payments
  3. The IPP Menu should be shown. The activity indicator loads. The Manage card reader row is enabled after the onboarding finishes.
  4. The plugin selection row is added. Tapping on it moves to the plugin selection screen.
  5. Once there you can select a plugin or go back. Both moves to the IPP Menu Screen:

https://user-images.githubusercontent.com/1864060/183949431-5665acd0-b29a-423d-a143-fa9093bb54cb.mp4

The onboarding is not previously finished

  • Prerequisites: The card present onboarding is not finished.
  1. Go to Menu
  2. Tap on Payments
  3. The IPP Menu should be shown. The activity indicator loads.
  4. The Manage card reader row stays disabled.
  5. A notice is shown pointing to the onboarding.
  6. Tapping on Continue Setup moves to onboarding.
  7. When the onboarding is successfully finished the IPP Menu shows the Manage card reader row enabled

https://user-images.githubusercontent.com/1864060/183948551-1442a6d6-fac1-4c3c-9794-d35d3d7b539a.mp4

Extra: IPP Settings work as expected with the feature flag disabled

As we still show the IPP Settings when the feature flag is disabled, we have to make sure that the work introduced with this PR do not cause any unwanted changes in the IPP Settings. To check that, disable the feature flag by returning false for the paymentsHubMenuSection feature flag in this line

  1. Disable the feature flag
  2. Tap on Menu
  3. Tap on the Settings button
  4. Tap on In-Person Payments
  5. Make sure that no activity indicator or notice is shown. Play around, and double-check that everything looks normal. In this video, we see the case when the two payment plugins are enabled.

https://user-images.githubusercontent.com/1864060/183954016-a60d6361-5c54-4dea-a9cb-9af9eb49041e.mp4

Screenshots


  • [X] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

toupper avatar Aug 10 '22 15:08 toupper

You can test the changes from this Pull Request by:

  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr7451-e84b53d on your iPhone
If you need access to App Center, please ask a maintainer to add you.

wpmobilebot avatar Aug 10 '22 16:08 wpmobilebot

Warnings
:warning: This PR is assigned to a milestone which is closing in less than 4 days Please, make sure to get it merged by then or assign it to a later expiring milestone
Messages
:book:

This PR contains changes to Tracks-related logic. Please ensure the following are completed: PR Author

  • The PR must be assigned the Tracks label PR Reviewer
  • The tracks events must be validated in the Tracks system.
  • Verify the internal tracks spreadsheet has also been updated.

Generated by :no_entry_sign: dangerJS

peril-woocommerce[bot] avatar Aug 12 '22 14:08 peril-woocommerce[bot]

👋 @toupper , was looking at the PR and noticed that after tapping on Continue Setup, the user would go through the onboarding check again before being shown the setup/error screen.

This was reported and fixed for Android in https://github.com/woocommerce/woocommerce-android/pull/7159 , is a similar improvement possible on iOS (to avoid another onboarding check after tapping on Continue Setup)?

jostnes avatar Aug 15 '22 08:08 jostnes

Thanks for finding that issue @jostnes!

I created an issue and will address it right away :)

toupper avatar Aug 15 '22 10:08 toupper