question

tj89537 avatar image
tj89537 asked tj89537 edited

Hosted iFrame Sandbox issues

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)

  1. Initialize Clover with key (having issues with this one)
  2. clover.createToken
    1. This is returning undefined

Server Side (JS)

  1. fetch request to https://scl-sandbox.dev.clover.com/v1/charges
    1. method: "POST
    2. body : JSON.stringify({amount, source (token from #2 on client), currency: "USD"})
    3. 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!

e-commerce apiaccess tokenclover-hosted-iframe
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community