My woocommerce checkout is showing and up till this morning was working fine. But now when I try to submit the form I get this message: “We were unable to process your order, please try again”. I haven’t changed anything in the settings or plugins. I have updated woocommerce recently to 2.3.5. But still, everything worked perfectly after that. I really don’t get what’s going on here. I hope someone can help me out.
Thanks!
PS: I get this error message with everything, even when I leave a billing field open…
_____ EDIT ______
I found the function which throws the error:
if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'woocommerce-process_checkout' ) ) {
WC()->session->set( 'refresh_totals', true );
throw new Exception( __( 'We were unable to process your order, please try again.', 'woocommerce' ) );
}
This is located in in woocommerce/includes/class-wc-checkout.php on line 351.
I got the solution. With the WooCommerce 2.3.5 update, two new files got added: payment.php & payment-method.php. In payment.php there’s this line:
Somehow this line got removed in my child theme.
Someone mentioned that they had this problem when using the GoogleRECAPTCHA plug-in with Woocommerce. They disabled it, and the problem went away. 🙂
@SPS if you really are on woocommerce 2.3.5, there should be the file payment.php
wp-content/plugins/woocommerce/templates/checkout/
Meanwhile, that’s not the actual culprit in my own case; (as there was already
there )
It’s rather the fact that inside, the process_payment(){} function of my payment plugin, i was returning:
instead of
Check your code to change that too, and the problem will dissapear. 🙂
As an alternate fix, if you are using a self-signed SSL certificate in staging (or if your SSL is expired) and you have elected to force https in the checkout view, it will cause PayPal to fail with this rather unhelpful message.
You’ll know you have this problem because WordPress will be constantly logging you out of the admin and forcing you to re-authenticate any time the secure/insecure hand off happens.