Skip to content

Apple Pay checkout fails in Safari Private Browsing #747

Description

Description

Apple Pay checkout fails when the storefront is opened in a Safari Private Browsing window. The Apple Pay button renders, but the payment session does not complete.

Steps to reproduce

  1. Open the storefront in Safari in a Private Browsing window.
  2. Add a product to the cart and go to checkout.
  3. Attempt to pay with Apple Pay.

Expected behaviour

The Apple Pay payment sheet opens and the payment completes normally, as it does in a regular Safari window.

Actual behaviour

The payment session fails/cancels (exact symptom not yet captured — see "Next steps" below).

Suspected root cause

The issue is most likely not the capability check in render() (swag-paypal.apple-pay.js#L29):

if (!window.ApplePaySession?.supportsVersion(4) || !window.ApplePaySession?.canMakePayments()) {

Apple's developer documentation states that canMakePayments() returns identically regardless of Private Browsing, so this check should pass either way.

The more likely fault line is the merchant validation step in handleValidateMerchant() (swag-paypal.apple-pay.js#L87-L99):

const { merchantSession } = await paypal.Applepay().validateMerchant({
    validationUrl: event.validationURL,
    displayName: this.options.displayName,
});

This is a live cross-origin network call from the browser to PayPal's Apple Pay validation endpoint, triggered via session.onvalidatemerchant. Safari Private Browsing's storage partitioning / Intelligent Tracking Prevention (blocked or partitioned cookies for cross-origin requests) is the prime suspect for breaking this call. This matches multiple reports on the Apple developer forums of onvalidatemerchant silently failing to fire, or oncancel firing immediately after session.begin(), in restrictive browsing contexts:

Next steps for whoever picks this up

The exact console error has not been live-reproduced yet. Please capture the browser console and network tab output when handleValidateMerchant() runs in a Private Browsing window, to confirm whether the validateMerchant request is being blocked/rejected by ITP/storage partitioning, or whether the failure occurs elsewhere (e.g. oncancel firing before onvalidatemerchant).

Environment

  • Plugin: SwagPayPal (file: src/Resources/app/storefront/src/checkout/swag-paypal.apple-pay.js)
  • Browser: Safari, Private Browsing mode

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

Priority

Low

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions