Skip to content
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 - payments onboarding] Update WooPayments setup URL from Payments Overview to Payments Connect #14297

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

jaclync
Copy link
Contributor

@jaclync jaclync commented Nov 4, 2024

Part of #14296

Why

As recommended by the WooPayments web team in pdfdoF-5Bo-p2#comment-6655:

If the intent is to point merchants to a webview from where they can start/continue their WooPayments onboarding specifically (with WooPayments installed and activated), you can continue using admin.php?page=wc-admin&path=%2Fpayments%2Foverview, or, better yet, you can use admin.php?page=wc-admin&path=%2Fpayments%2Fconnect. WooPayments will take care of redirecting between the two.

This PR aims to change the payments setup URL from Payments Overview to Payments Connect.

After testing on a few sites (Pressable, WPCOM, JN), the Payments Overview (when tapping on the Payments menu on the left sidebar in wp-admin) and Payments Connect are the same right now. Conceptually, the Connect page makes more sense to set up / connect the payments account while the Overview page might contain other information that could distract the merchant away from connecting the account.

How

This PR only changes the URL from Payments Overview to Payments Connect.
The addition of a from parameter will be in a separate PR as it involves more code changes that I'm less sure about.

There are two use cases of the payments setup URL:

  • InPersonPaymentsPluginNotSetup
  • InPersonPaymentsStripeAccountOverdue

Steps to reproduce

Since this change affects the existing onboarding flow for all entry points (POS, IPP, Payments menu), I think focusing on testing the most critical flow, IPP, is the best use of time.

Stripe overdue

Prerequisite: store payment gateway is active and set up but account has account.wcpayStatus == .restricted && account.hasOverdueRequirements. Alternatively, you can hard code the state by returning .stripeAccountOverdueRequirement(plugin: .wcPay) at the beginning of CardPresentPaymentsOnboardingUseCase.checkOnboardingState.

  • Log in to the store with site credentials
  • Go to the orders tab
  • Create an order
  • Enter a custom amount or add some products then recalculate
  • Collect payment
  • Tap Card Reader --> an onboarding modal should be shown. after the loading state, the Stripe overdue UI should be shown
  • Tap Resolve Now --> a webview should be shown. log in to wp-admin if needed for WPCOM login. the webview should show how to connect to the payment account, and should be the same as when tapping on the Payments tab on the left sidebar

Payments plugin not set up

Prerequisite: store payment gateway is active but isn't set up completely. Alternatively, you can hard code the state by returning .pluginSetupNotCompleted(plugin: .wcPay) at the beginning of CardPresentPaymentsOnboardingUseCase.checkOnboardingState.

  • Log in to the store with site credentials
  • Go to the orders tab
  • Create an order with a custom amount or product, or tap on an order ready for payment collection
  • Collect payment
  • Tap Card Reader --> an onboarding modal should be shown. after the loading state, the plugin not set up UI should be shown
  • Tap Finish Setup in Store Admin --> a webview should be shown. log in to wp-admin if needed for WPCOM login. the webview should show how to connect to the payment account, and should be the same as when tapping on the Payments tab on the left sidebar

Testing information

I couldn't reproduce the actual scenario of "Stripe overdue" onboarding state, so I tested by manually returning the state in code.

Screenshots

Example for the "plugin not set up" error:

Simulator.Screen.Recording.-.iPad.Pro.11-inch.M4.-.2024-11-04.at.12.59.56.mp4

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

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

…o Payments Connect based on web team recommendation.
@jaclync jaclync added type: task An internally driven task. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. labels Nov 4, 2024
@jaclync jaclync added this to the 21.1 milestone Nov 4, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 4, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14297-d73d2f3
Version21.0
Bundle IDcom.automattic.alpha.woocommerce
Commitd73d2f3
App Center BuildWooCommerce - Prototype Builds #11427
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@jaclync jaclync marked this pull request as ready for review November 5, 2024 01:23
@staskus staskus self-assigned this Nov 5, 2024
Copy link
Collaborator

@staskus staskus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ I tested payment onboarding scenarios from scratch and the link worked well I didn't find cases where it didn't open the account overview. (I integrated this change since otherwise Stripe connection would fail)

I also tested the hardcoded scenarios and they worked as described as well.

I remember @joshheald had thoughts on this URL change, is there anything else we should check to raise our confidence that the URL change doesn't break onboarding?

@joshheald
Copy link
Contributor

I remember @joshheald had thoughts on this URL change, is there anything else we should check to raise our confidence that the URL change doesn't break onboarding?

Nope, no concerns from me about this. I think you might be thinking of when we start using payments_enabled, which the web team also suggested.

@staskus did you check actually completing the information from the new link? Or just that it opened? I don't think it should be a problem but I'm on alert about that after finding it in the beta the other day. That was an authentication change though, so this should be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: mobile payments Related to mobile payments / card present payments / Woo Payments. type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants