Hello,
parquet76 has been helping me on this. I'd appreciate some more input from others.
I am successfully running this code on my server:
https://codepen.io/davidmarginian/pen/JjXLRwM
When I replace the ecommerce API token used by that javascript file with my own public token from my developer account, Test Merchant, the call to clover.createToken() fails with a CORS error.
Why is that happening? What's wrong with my developer account or token?
Next, I tried the same code using the live SDK and the public token from my client's live merchant account, with recaptcha turned either ON or OFF (doesn't matter), and the test fails with the CORS error.
The error is (replace the URL depending on sandbox or live environment):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://token-sandbox.dev.clover.com/v1/tokens. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 401.
I've tried fixing this CORS error via Apache on my server, to no avail.
Any help much appreciated. Thanks.