So after some exploration and chat with Angeleye on his support system we have uncovered the error’s cause.
I was using the Express checkout button from the Woocommerce checkout page, not from the Cart or Product pages. But that alone isn’t the root cause. The default Woocommerce checkout page collects Billing Details via a required form that the user fills in before clicking the Pay Now button.
Normally this wouldn’t cause the error.
However my billing details form was customised by me (via functions.php in my theme) to only collect certain details and to not collect other details that would be normally required. I had forced Woocommerce to ‘skip’ the requirement for ‘Address Line 1’ and ‘Postcode’. The reasoning was that I didn’t want or need these details for my purposes as a merchant selling non-shippable goods.
Although error 10727 was showing (which regards address line 1), there was also an error for the missing Postcode.
So what seems to have happened is this:
I collected “some” (but not all) billing details on the site on the checkout page. When the user then clicks Pay Now (to “proceed to paypal”), that information is sent to Paypal Express to process with the payment. Paypal Express normally doesn’t require this information as PP Express is intended to take care of that. Meaning one of the major ‘benefits’ of PP Express is that the user doesn’t ‘need’ to enter any billing details on the WordPress/Woocommerce site, the user can do this in one go from the PP Express page.
However, if the WP/WC site does collect billing information, then PP Express attempts to process the payment with those details. So when it received the user’s partially completed billing details (missing address line 1 and postcode), it failed, and returns the user to the cart page where the error message is displayed.
So how to fix?
Well fairly easily and there are 2 or 3 ways.
1. Add the missing fields to the checkout page. This should then give PP Express everything it needs to process the payment with the billing details supplied from the WP site. (though i haven’t tested this)
2. Force remove all the billing details fields from the form on the Woocommerce checkout page. This worked for me and allowed me to keep using the Checkout page.
3. Use the Proceed to Paypal button on the Woocommerce Cart page, thus skipping the need for the Checkout page entirely. This is the best solution if the only payment gateway you’re using is PP Express. Which is the case for me so I’m going to implement it. This way users have 1 less step to go through towards converting.
NOTES: If you still have problems it is worth experimenting with the check box labelled “Set billing address in WooCommerce using the address returned by PayPal.” in the Woocommerce settings under Checkout > Paypal Express Checkout (near the bottom of the page). You may also want to experiment editing the ‘noshipping’ => ” line in the wc_gateway_paypal_express_angelleye.php file in the classes folder of the plugin. You can set it to 1 or leave it empty. Apparently this option may be making its way into the settings page for the plugin but for now you’ll have to edit the plugin file directly.
Big shout out to Angeleye who provides great support and this is a great plugin.