-
Notifications
You must be signed in to change notification settings - Fork 10.8k
[Payments NOX] Use backend-provided URLs for resetting onboarding and disabling test accounts #60192
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
[Payments NOX] Use backend-provided URLs for resetting onboarding and disabling test accounts #60192
Conversation
…sable test account
📝 WalkthroughWalkthroughThis change introduces new REST API endpoints, type definitions, and frontend logic to support dynamic, runtime-generated URLs for resetting WooPayments accounts and disabling test accounts during onboarding. It updates backend schemas, onboarding steps, and React component props to use these new links, removing previous hard-coded URLs and utility functions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ReactComponent
participant API
participant WooPaymentsRestController
User->>ReactComponent: Click "Reset Account" or "Disable Test Account"
ReactComponent->>API: POST to dynamic reset/disable URL
API->>WooPaymentsRestController: Handle request (reset/disable)
WooPaymentsRestController->>API: Return result
API->>ReactComponent: Response (success/failure)
ReactComponent->>User: Update UI (proceed/notify)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Size Change: +15 B (0%) Total Size: 5.91 MB
|
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Testing GuidelinesHi @elazzabi , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions check out! I tested with different permalinks options, onboarding a test account, resetting, and initiating an embedded onboarding... everything works as expected.
Hi @vladolaru! Your PR contains REST API changes. Please consider updating the REST API documentation if your changes affect the public API. Changed API files:
|
No need to worry about documenting REST API changes since the affected APIs are for internal use only (at least for now). |
Submission Review Guidelines:
Changes proposed in this Pull Request:
We replace the JS hard-coded relative REST API endpoint paths with backend-provided account reset and test account disable full REST API endpoint URLs that are build dynamically thus taking into consideration the permalink structure of the site (plain or pretty permalinks).
For the WooPayments NOX in-context steps I decided to wrap the general endpoints into step-specific ones to keep the concerns separate and not wrangle data outside each step.
Closes WOOPLUG-5250
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
France
./wp-admin/admin.php?page=wc-settings&tab=checkout&path=%2Fwoopayments%2Fonboarding
).Repeat steps 5 to 13, but first go to Settings > Permalinks and set the permalink structure to "Post name" ( and thus use pretty permalinks).
Testing that has already taken place:
I tested the same steps as the testing instructions.
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment