Skip to content

Add check if plugin setup is completed #11549

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

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

samiuelson
Copy link
Contributor

@samiuelson samiuelson commented May 20, 2024

This PR updates conditions to show the POS entry point - now it's required that Woo Payments onboarding is complete.
Context: p91TBi-beb-p2#comment-12134

Testing instructions

  • Verify "Woo POS" button is visible in the menu more screen if the Woo Payments onboarding is completed (plus other conditions are met – big screen size, USD currency, US location, and Woo Payments plugin activated)
  • You can also verify the button is not present in case onboarding is not completed
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@samiuelson samiuelson marked this pull request as ready for review May 20, 2024 14:35
@samiuelson samiuelson requested review from malinajirka and kidinov May 20, 2024 14:35
@samiuelson samiuelson added this to the 18.8 milestone May 20, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 20, 2024

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

App Name WooCommerce Android
FlavorJalapeno
Build TypeDebug
Commitbab839e
Direct Downloadwoocommerce-prototype-build-pr11549-bab839e.apk

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.44%. Comparing base (2b56352) to head (bab839e).
Report is 303 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #11549   +/-   ##
=========================================
  Coverage     40.44%   40.44%           
- Complexity     5196     5200    +4     
=========================================
  Files          1083     1083           
  Lines         62996    62999    +3     
  Branches       8628     8630    +2     
=========================================
+ Hits          25479    25482    +3     
  Misses        35224    35224           
  Partials       2293     2293           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@malinajirka malinajirka self-assigned this May 21, 2024
@samiuelson samiuelson marked this pull request as draft May 21, 2024 08:17
@malinajirka malinajirka removed their assignment May 21, 2024
).also { cachedResult = it }
}

private fun isPluginSetupCompleted(paymentAccount: WCPaymentAccountResult): Boolean =
paymentAccount.status == WCPaymentAccountResult.WCPaymentAccountStatus.COMPLETE
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ I'll follow up on the P2, but just a heads-up that this doesn't handle the scenario when there are pending but skippable requirements on the Stripe's account.

Copy link
Contributor Author

@samiuelson samiuelson May 29, 2024

Choose a reason for hiding this comment

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

As per the decision (p91TBi-bje-p2), I've loosened the status requirement to ENABLED. I don't have a full understanding of all the status types though, so I'd appreciate it if you could confirm (@malinajirka or @kidinov) if the condition matches the following requirement:

- ...
- Onboarding is Completed (optional requirements should be considered as valid).
- ...

Copy link
Contributor

@kidinov kidinov May 30, 2024

Choose a reason for hiding this comment

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

@malinajirka @samiuelson 👋

As for M1, it's planned to implement a "happy path" only, shall we assume that only the completed state is exacted for now? Handling optional requirements is done on å full-screen fragments, so it may bring some complexity to the initial implementation of connection/payment flows. In any case I added a ticket to handle that - we just need to decide priorities - for M1 or latter.

#11612

Copy link
Contributor

Choose a reason for hiding this comment

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

Allowing users to enter the POS with pending requirements but crashing (implementing only the happy path) sounds like a good approach for now. I've added high priority label to the issue just to make sure we don't leave the code in the crashing state.

I've loosened the status requirement to ENABLED. I don't have a full understanding of all the status types though,

I believe this should be enough - we'll need to eventually test all the flows though. We had a pretty detailed test plan for the onboarding project so we should be able to look it up and re-use it.

@samiuelson
Copy link
Contributor Author

I'm marking PR as a draft to wait for the final decision.

@backwardstruck backwardstruck modified the milestones: 18.8, 18.9 May 24, 2024
@samiuelson samiuelson marked this pull request as ready for review May 29, 2024 18:51
Copy link
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@malinajirka malinajirka merged commit 3d04f37 into trunk Jun 3, 2024
13 of 14 checks passed
@malinajirka malinajirka deleted the update-pos-entry-point-conditions branch June 3, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants