Start a free 14-day trial by December 1 on a wide range of WooCommerce Marketplace extensions and themes. Explore products

Allow additional checkout origins for WooPay

If a checkout is served from an additional domain and WooPay session requests are rejected, a developer can add the checkout origin to the allowed origins.

Note:

This is a developer-level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customization work. We are unable to provide support for customization under our Support Policy.

Before you start

↑ Back to top

Confirm that the WooPayments log reports a rejected origin and identify the checkout origin. An origin consists of its scheme, hostname, and any non-default port. Only allow origins you control and trust to access the WooPay session endpoints. Test the change on a staging store.

Allow an additional origin

↑ Back to top

In WooPayments 11.3.0 or later, add the following filter in a custom plugin. Replace the example origin with the exact checkout origin:

add_filter(
	'wcpay_woopay_session_allowed_origins',
	function ( $origins ) {
		$origins[] = 'https://shop.example.com';
		return $origins;
	}
);

Verify the change

↑ Back to top

Retry WooPay from the additional checkout domain and inspect the WooPayments log for the rejected-origin message. Remove the filter to restore the default allowed origins. If the request still fails, investigate the new log message and checkout configuration.

Questions and support

↑ Back to top

Do you still have questions and need assistance? 

  • Get in touch with a Happiness Engineer via our Help Desk. We provide support for extensions developed by and/or sold on WooCommerce.com, and Jetpack/WordPress.com customers.
  • If you are not a customer, we recommend finding help in the WooCommerce support forum or hiring a Woo Agency Partner. These are trusted agencies with a proven track record of building highly customized, scalable online stores. Learn more about Woo Agency Partners.

Related Products

WooCommerce Subscriptions is a WooCommerce extension that lets customers subscribe to your products or...

Offer add-ons like gift wrapping, special messages or other special options for your products.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.