ALERT: PayPal broken with WooCommerce – Fix is here

Update: This issue has now been fixed by PayPal and you don’t need to do anything. If you suffered lost revenue today, direct your questions at PayPal.

 

PayPal has been intermittently broken with WooCommerce for a little while now, but normally trying to check out again would fix it, or switching to Firefox.

This is obviously not good for your revenue if you’re using PayPal with WooCommerce.

10 hours ago, things got worse. It seems PayPal has altered how they are handling the ‘cancel url’ and they are outright rejecting any URLs which don’t conform.

Here are the three different error messages your users will be intermittently seeing:

A fix is yet to be released by WooCommerce and/or PayPal but in the meantime, here are a couple of ways to fix it:

Fix by adding filter to functions.php

If you’re comfortable editing code, stick this in your functions.php file until WooCommerce confirm the problem is fixed – then you can remove it.


add_filter( 'woocommerce_paypal_args', 'woo_override_cancel_url', 10, 2 );
function woo_override_cancel_url( $args, $order ) {
$args['cancel_return'] = urlencode( $order->get_cancel_order_url_raw() );
return $args;
}

Install my ‘Fix woo cancel url’ plugin

If you don’t want to edit code, I made a plugin for you. Original title I know – it’s literally just the code above inside the plugin.

You can download a copy here: https://www.wpintense.com/assets/plugins/fix-woo-cancel-url.zip

Notes

This fix may break the ability for users to click ‘cancel’ and return correctly to your store. That’s not as bad as not being able to transact.

Further Reading

You can find out more about how this issue is progressing at the following two links:

https://github.com/woocommerce/woocommerce/issues/14956

https://wordpress.org/support/topic/transaction-cancelled/

 

Chat to me

Dave Hilditch

Founder at WP Intense
Dave has been programming since 6 years old and has been developing WordPress plugins, themes and websites since 2010. In the past he built the browse view technology for Skyscanner and now he helps clients with interesting website challenges.

He is always on at least one of his computers when he's awake, so get in touch and he'll get right back to you.
Chat to me

Latest posts by Dave Hilditch (see all)