Skip to content

Fix PayPal Submit staying disabled after a cancelled pop-up - #3767

Open
vivi-the-going-merry[bot] wants to merge 1 commit into
masterfrom
fix/issue-7052-paypal-cancel-running
Open

vivi-the-going-merry[bot] wants to merge 1 commit into
masterfrom
fix/issue-7052-paypal-cancel-running

Conversation

@vivi-the-going-merry

@vivi-the-going-merry vivi-the-going-merry Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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, and enableSubmit() returns early while running > 0.

Changed

onCancel() in paypal/js/frontend.js now releases the order (guarded by running > 0, because subscription and Apple Pay cancels start no order) and, once nothing is in flight, calls updateSubmitButtonVisibility() for the selected method.

Verified

  • node --test tests/js/paypalBootstrap.test.mjs: red before the fix (running stayed 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).
  • Not tested: against a PayPal sandbox. The pop-up can't render in our lab, so the cause was traced in code, as the issue says. The other tests/js files need npm install, which I didn't run.
  • Recurring (createSubscription()) cancel followed by Credit Card is not exercised: it never increments running, so it is unaffected by this change.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants