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 topConfirm 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 topIn 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 topRetry 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 topDo 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.