Skip to content

[Bug] createPayPalSubscriptionPaymentSession failing intermittentlyΒ #884

@alexedwardjones

Description

@alexedwardjones

Library used

Direct script integration β€” https://www.paypal.com/web-sdk/v6/core

🐞 Describe the Bug

Intermittently, authenticated PayPal users are redirected to an error screen at https://www.paypal.com/webapps/hermes/error?token=....

Image

πŸ”¬ Minimal Reproduction

const sdkInstance = await window.paypal.createInstance({
    clientId: '...',
    components: ['paypal-subscriptions'],
});

const session = await sdkInstance.createPayPalSubscriptionPaymentSession({
    onApprove: async () => { /* redirect to success */ },
    onCancel: () => { /* reset UI */ },
    onError: () => { /* show error */ },                                         
});
                                                                                 
// On button click:                                       
await session.start({ presentationMode: 'popup' }, subscriptionPromise);
// where subscriptionPromise resolves to { subscriptionId }

πŸ˜• Actual Behavior

Intermittently, authenticated PayPal users are routed through https://www.paypal.com/web-sdk/content/en-GB/paypal-loading and then immediately redirected to an error screen at https://www.paypal.com/webapps/hermes/error?token=... (screenshot above). The popup never proceeds past the loading page when this occurs. The failure is inconsistent, it doesn't happen on every attempt, and I haven't been able to identify a pattern.

πŸ€” Expected Behavior

The subscription popup should open successfully and allow the authenticated user to complete the payment, consistent with the behaviour seen for one-time payments using createPayPalOneTimePaymentSession which is working fine for us.

🌍 Environment

  • Node.js/npm: -
  • OS: -
  • Browser: -

βž• Additional Context

We can't find createPayPalSubscriptionPaymentSession referenced anywhere in the official v6 documentation, the upgrade guide, or the https://github.com/paypal-examples/v6-web-sdk-sample-integration (which only covers one-time payments). The v6 docs list createPayPalOneTimePaymentSession, createPayLaterOneTimePaymentSession, createPayPalCreditOneTimePaymentSession, and createFastlane but nothing for subscriptions.

Is createPayPalSubscriptionPaymentSession an officially supported and stable API?
Is the paypal-subscriptions component considered production-ready?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions