question

sebadinamic avatar image
sebadinamic asked ·

How to get key for clover-hosted iframe integration

Hi!

I created a webpage that integrates categories, products and order creation with REST API. The next step is payment.
The first problem is the key to use in:

- const clover = new Clover('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

How can i get this key? Thanks!

Payments
2 comments
10 |2000 characters needed characters left characters exceeded

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

Once I have the clover-hosted iframe integrated, how can i associate the charge recently created with the oder previously created (with v3/merchants/mId/orders)?

The charge created with the iframe, generate a new order with one product with "amount" price but i have already created an order with products and i want to relate the order with the payment. Is this possible?


0 Likes 0 · ·

You will follow the docs here (as it appears you have already done):

https://docs.clover.com/docs/using-the-clover-hosted-iframe

But, instead of creating the charge, you will use the returned token to pay for the order:

https://docs.clover.com/docs/creating-and-paying-for-orders-sdk

See "Paying for an order with a source"

0 Likes 0 · ·

1 Answer

David Marginian avatar image
David Marginian answered ·

https://docs.clover.com/docs/using-the-clover-hosted-iframe

Configuring the SDK

To make payment requests on a merchant's behalf, set up the SDK to use the merchant's public key retrieved from the PAKMS endpoint.

  1. Create a clover constant and pass the merchant's key as the parameter of a new Clover object.
  2. Declare another constant for clover.elements(). This constant enables you to create card tokens based on information entered in an iframe. Each entity in the iframe is an element.
3 comments Share
10 |2000 characters needed characters left characters exceeded

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

Many thanks. Can i have this key with api token? I can´t create an app.

0 Likes 0 · ·

You have to create an app or you cannot get an access token.

1 Like 1 · ·
sebadinamic avatar image sebadinamic David Marginian ♦♦ ·

Many thanks David! Everything work fine now!

0 Likes 0 · ·

Welcome to the
Clover Developer Community