Fallback URI

 

WePay’s embedded checkout relies on the client’s browser accepting WePay cookies in order to successfully display the iframe.

Some browsers do not support third-party cookies. A prime example is Safari, which blocks third-party cookies by default. Rather than generating a support ticket and putting the onus on the payer to change this setting or use a different browser, you can implement the hosted_checkout.fallback_uri.

Here’s how to implement:

  1. For each embedded checkout page, generate another URI which will host the same checkout_uri returned in the /checkout/create response.
  2. These URIs should be predictable, so that you can include it in the /checkout/create request on the hosted_checkout.fallback_uri parameter.

That’s it! Once implemented, the iframe will force a redirect to wepay.com and then to the fallback URI that you’ve set when a third-party cookie error occurs. When your fallback URI is loaded, the browser will already have WePay cookies and the iframe will load successfully without third-party cookie errors.

Example

  1. Create embedded checkout and serve to the payer.
  2. Payer’s browser returns a thrid-party cookies error.
  3. Fallback URI protocol:
    • Redirect to wepay.com.
    • Redirect to supplied fallback_uri.
    • Re-load the iframe without third-party cookies error.
  4. Payer successfully completes payment.