Core SDK loading & PayPal buttons via v6 Web SDK (5780)#4526
Conversation
…gacy removal, multi-context rendering
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 What's included:
Login credentials:
Plugin Details:
🤖 Auto-generated for commit 17f8fac • Last updated: 2026-07-20T18:13:30.845Z |
stracker-phil
left a comment
There was a problem hiding this comment.
Ready to merge; all comments are nits/suggestions
Narek13
left a comment
There was a problem hiding this comment.
Really nice PR, thank you! It looks great to me. I’ve also added a couple of small suggestions on top of what @stracker-phil already mentioned, but I think we’re good to go. Thanks again! 🙂
4e96b7f
into
dev/PCP-5777-update-v-5-js-sdk-integration-to-v-6-web-sdk
Note: This PR is against the v6 SDK epic branch:
dev/PCP-5777-update-v-5-js-sdk-integration-to-v-6-web-sdkand notdev/developDescription
Core v6 Web SDK frontend:
createInstance()with a server-fetched client token, explicit eligibility viafindEligibleMethods()(currency/country/amount), one-time payment sessions and Web Component buttons for PayPal/Venmo/Pay Later across product, cart, checkout, and classic mini-cart.ppc-*endpoints through one JS adapter and reuses existing services/helpers (SettingsStatus, styling DTOs,Context,SingleProductActionHandler,ErrorHandler). Only change outside the module: onedo_actioninCreateOrderEndpoint(stores the session order for non-checkout contexts; v5 unchanged).Migration methodology (v5 and v6 side by side): during the epic, every payment surface is owned by exactly one stack. A single function (
SdkV6Manager::should_load_on_current_page()) decides per page whether v6 loads. On those pages the v5 smart buttons are suppressed, since both SDKs claimwindow.paypal. Everywhere else (block cart/checkout, pay-now, wallets, messaging) v5 keeps running untouched. This keeps the site and the QA/e2e suites fully functional after every story lands: each subsequent ticket simply widens what v6 owns instead of adding per-surface toggles or shims. The handoff is migration-phase scaffolding only, marked for removal at release (seeextensions.php). The end state is a whole-flow flag flip: v5 or v6, never a per-page mix.Screenshots
Missing on the v6 side by design: messaging, wallets - included in separate tickets
Steps to Test
Setup: flag on via
PCP_SDK_V6_ENABLED=1(or filterwoocommerce.feature-flags.woocommerce_paypal_payments.sdk_v6_enabledset to true), sandbox-connected store,npm run build.#ppc-button-ppcp-gateway-v6. Network showsweb-sdk/v6/coreplus oneppc-sdk-v6-client-tokenPOST, and nopaypal.com/sdk/js. No[PPCP SDK v6]console errors.update-customer(non-emptystate) andppc-update-shippingfire, popup totals update.dev/develop).npm run unit-tests,npm run test:unit-js,npm cp-blocks/checkout-handlerJS failures are unrelated; they fail ondev/developtoo).