Benedict Wallis
Forum Replies Created
-
Thanks for taking a closer look.
We do have a custom handler in place for international orders which restricts the available payment gateways. However, this logic only affects the list returned via woocommerce_available_payment_gateways, and doesn’t touch any script loading or REST setup.
I will look to create a support ticket.Hi @mrclayton,
I tried enabling only the PayPal Credit Card Gateway, and disabled standard PayPal Gateway but the error still occurs in this configuration.
To help you investigate further, I’ve temporarily left the plugin active on the live site for a few hours. You can see it in action at: https://www.primetools.co.uk
Add any item to the cart and proceed to checkout using the CheckoutWC flow to observe the issue (check the console for the invalid_json error). (You might need to use a UK billing address, as they handle international delivery manually)
Let me know if there’s anything else I can do to assist.
- This reply was modified 10 months, 1 week ago by Benedict Wallis.
Hi @mrclayton Thanks for the quick response,
It’s a bit difficult for me to leave the plugin enabled in production, but I’ve done local debugging and wanted to share what I’ve found:
The error originates from originates fromassets/js/ppcp/cart.jsduring this call:const response = await apiFetch({
method: 'POST',
url: getRestRoute('cart/refresh'),
data: { page: this.page },
});This uses the helper in
utils.js:export const getRestRoute = (route) => {
return getSetting('generalData')?.restRoutes?.[route]?.url || null;
};However,
getSetting('generalData')seems to returnundefined, which causes the function to return null, and the request ends up being sent to/checkout/instead of a valid REST endpoint, which returns HTML, not JSON — triggering the error.
Hopefully this helps! Let me know if you have any further info…Forum: Plugins
In reply to: [WooCommerce] Woo 4.4.1 > PayPal Pro Hosted not connectingFor me the issue was caused by Cloudflare’s Rocket Loader feature, adding a bypass rule to the checkout page seems to have resolved it.
Forum: Plugins
In reply to: [WooCommerce] Woo 4.4.1 > PayPal Pro Hosted not connectingFor me this happens in multiple browsers. In Chrome there are no JavaScript errors, in FireFox I see:
Invalid X-Frame-Options header was found when loading “https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?hosted_button_id=HSSS-tyhe2Ovt30ttx7JdGO9Uw77goiHzuhw414gjadlYF7aqgd5qkqddyz1-Z9.w1SaymccbFw”: “ALLOWALL” is not a valid directive.
The issue does seem to be JavaScript side – in that the BlockUI component is not removed / hidden as expected: If I remove it manually in the browser I can continue to payment as normal.
Forum: Plugins
In reply to: [WooCommerce] Woo 4.4.1 > PayPal Pro Hosted not connecting@fatpotanga I’m also experiencing this problem did you find a solution?