-
Notifications
You must be signed in to change notification settings - Fork 619
Move success URL handling from PayPage to StyledBuyWidget component #8342
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
Move success URL handling from PayPage to StyledBuyWidget component #8342
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Caution Review failedThe pull request is closed. WalkthroughThe success URL redirect logic is being refactored from the PayPage component into the StyledBuyWidget component. StyledBuyWidget now accepts a successUrl prop and internally handles navigation with a success query parameter when the BuyWidget succeeds. Changes
Sequence Diagram(s)sequenceDiagram
participant PayPage
participant StyledBuyWidget
participant BuyWidget
participant Browser
Note over PayPage,Browser: Before: Redirect logic in PayPage
PayPage->>StyledBuyWidget: onSuccess callback handler
StyledBuyWidget->>BuyWidget: passes onSuccess callback
BuyWidget->>StyledBuyWidget: trigger onSuccess
StyledBuyWidget->>Browser: navigate to successUrl + query param
Note over PayPage,Browser: After: Redirect logic in StyledBuyWidget
PayPage->>StyledBuyWidget: successUrl prop
StyledBuyWidget->>BuyWidget: internal onSuccess handler
BuyWidget->>StyledBuyWidget: success event
StyledBuyWidget->>Browser: navigate to successUrl + query param
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8342 +/- ##
=======================================
Coverage 54.87% 54.87%
=======================================
Files 919 919
Lines 60653 60653
Branches 4117 4117
=======================================
Hits 33283 33283
Misses 27268 27268
Partials 102 102
🚀 New features to boost your workflow:
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
size-limit report 📦
|

TL;DR
Refactored the Buy Widget component to handle success URL redirection internally rather than in the parent component.
What changed?
StyledBuyWidgetcomponent to accept asuccessUrlprop instead of callback handlersPayPagecomponent into theStyledBuyWidgetcomponentStyledBuyWidgetprops to excludeonSuccess,onError, andonCancelfrom the base props and add the newsuccessUrlpropHow to test?
success=trueparameter appendedWhy make this change?
This change improves component encapsulation by moving the redirection logic into the widget itself, making the parent component cleaner and the widget more self-contained. It also ensures consistent handling of success redirects across all implementations of the Buy Widget.
Summary by CodeRabbit