WooCommerce + Ionic: Unable to signup and checkout

2020-02-02 04:22发布

问题:

I am working on a project that integrates WooCommerce with Ionic 3 and I am having problems with the signup and checkout functionality. I am able to read products and login from my WooCommerce site, but every time I do a post request, I am getting these errors:

{"errors":[{"code":"woocommerce_api_authentication_error","message":"Invalid signature - provided signature does not match."}]}

How can I fix it?

回答1:

Make sure you have the following code in your .htaccess file on the top. You can find this file in the root of your WordPress.

RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $l [R=200,L]

Also enable CORS on your browser.