Skip to content

Unsuccessfully sandbox onboarding via wizard (6714)#4555

Merged
stracker-phil merged 2 commits into
dev/release/4.1.2from
dev/PCP-6714-unsuccessfully-sandbox-onboarding-via-wizard-connecting-under-button-for-live-account
Jul 24, 2026
Merged

Unsuccessfully sandbox onboarding via wizard (6714)#4555
stracker-phil merged 2 commits into
dev/release/4.1.2from
dev/PCP-6714-unsuccessfully-sandbox-onboarding-via-wizard-connecting-under-button-for-live-account

Conversation

@Dinamiko

@Dinamiko Dinamiko commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Enabling Sandbox Mode and clicking "Connect Account" opened PayPal onboarding in a new tab instead of minibrowser, and never connected. PayPal's partner.js uses a single global, takes its environment from its own script domain, and only wires the first [data-paypal-button]. The plugin always loaded the production SDK with both buttons present (live first), so only the live button got bound; the sandbox button stayed a plain link.

PR changes

  • useHandleConnections.js: load the environment-specific partner.js (production/sandbox) only for the button matching the Sandbox toggle, resetting window.PAYPAL on switch.
  • ConnectionButton.js: only the active-environment button is a real [data-paypal-button] (so PayPal binds it); added a click-guard that blocks clicks until the button is actually bound.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

🔗 Test this pull request with WordPress Playground

What's included:

  • ✅ WordPress (latest)
  • ✅ WooCommerce (latest)
  • ✅ PayPal Payments plugin v4.1.2-pr4555-30099596893-gd7b52d8 (built from this PR)

Login credentials:

  • Username: admin
  • Password: password

Plugin Details:

  • Version: 4.1.2-pr4555-30099596893-gd7b52d8
  • Commit: 7c8a74c
  • Artifact: woocommerce-paypal-payments-4.1.2-pr4555-30099596893-gd7b52d8

💡 The demo environment resets each time you refresh. Perfect for testing!

🔄 This link updates automatically with each new commit to the PR.

⚠️ This URL is valid for 30 days from when this comment was last updated.


🤖 Auto-generated for commit 7c8a74c • Last updated: 2026-07-24T14:09:36.832Z

@stracker-phil stracker-phil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, and local test also shows it solves the problem

@stracker-phil
stracker-phil merged commit 0fbf899 into dev/release/4.1.2 Jul 24, 2026
13 checks passed
@stracker-phil
stracker-phil deleted the dev/PCP-6714-unsuccessfully-sandbox-onboarding-via-wizard-connecting-under-button-for-live-account branch July 24, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants