Hi Everyone!
I've been trying to get an instance with a hosted iframe working and keep running into issues with the keys and tokens. I'm running Node.js with Express.
Using the Test Merchant account, I've added both Ecommerce API Tokens (Hosted iFrame + API/SDK), as well as API Tokens (Merchant-Read, Orders-Read, Payments Read/Write).
I managed to run my code with the key here: https://codepen.io/gareth-dsouza/pen/MWKbWwv and am able to get a response, but when it comes to using my own keys I'm totally lost and the documentation has led to about 6 tabs open and not much sense.
Right now the calls that I'm making are the following:
Client (HTML)
- Initialize Clover with key (having issues with this one)
- clover.createToken
- This is returning undefined
Server Side (JS)
- fetch request to https://scl-sandbox.dev.clover.com/v1/charges
- method: "POST
- body : JSON.stringify({amount, source (token from #2 on client), currency: "USD"})
- headers: {authorization: Bearer (Not 100% sure which token needs to go here now)}
Is there a straightforward, single-page document that walks a developer through how to do this, step-by-step that I haven't found? And once I get this working in the sandbox, what do I need to move to production?
Thanks!