woocommerce-ios
woocommerce-ios copied to clipboard
[Mobile Payments] Run onboarding check on the IPP hub screen asynchronously
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.
- Go to Menu
- Tap on Payments
- 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.
- Go to Menu
- Tap on Payments
- The IPP Menu should be shown. The activity indicator loads. The Manage card reader row is enabled after the onboarding finishes.
- The plugin selection row is added. Tapping on it moves to the plugin selection screen.
- 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.
- Go to Menu
- Tap on Payments
- The IPP Menu should be shown. The activity indicator loads.
- The Manage card reader row stays disabled.
- A notice is shown pointing to the onboarding.
- Tapping on Continue Setup moves to onboarding.
- 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
- Disable the feature flag
- Tap on Menu
- Tap on the Settings button
- Tap on In-Person Payments
- 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.
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
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
|
Generated by :no_entry_sign: dangerJS
👋 @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
)?