Repository navigation
Fix PayPal Submit staying disabled after a cancelled pop-up - #3767
Open
vivi-the-going-merry[bot] wants to merge 1 commit into
Open
vivi-the-going-merry[bot] wants to merge 1 commit into
vivi-the-going-merry[bot] wants to merge 1 commit into
Conversation
onCancel() never released the order createOrder() counted in `running`, so enableSubmit() returned early when Credit Card became valid. Release it (guarded, since subscription and Apple Pay cancels start no order) and refresh the submit button for the selected method. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Strategy11/formidable-pro#7052
Broken
On a PayPal Commerce form with card fields and checkout buttons, closing the PayPal/Venmo pop-up and then choosing Credit Card left Submit disabled even with a valid card.
createOrder()does++running,onCancel()never decrements it, andenableSubmit()returns early whilerunning > 0.Changed
onCancel()inpaypal/js/frontend.jsnow releases the order (guarded byrunning > 0, because subscription and Apple Pay cancels start no order) and, once nothing is in flight, callsupdateSubmitButtonVisibility()for the selected method.Verified
node --test tests/js/paypalBootstrap.test.mjs: red before the fix (runningstayed 1 and 2), 8/8 green after. New tests cover cancel with one order in flight, with none (no negative count), and with two (Submit state untouched).tests/jsfiles neednpm install, which I didn't run.createSubscription()) cancel followed by Credit Card is not exercised: it never incrementsrunning, so it is unaffected by this change.🤖 Generated with Claude Code