question

ubooktoday avatar image
ubooktoday asked David Marginian Deactivated commented

Clover eComm Iframe Integration type IFRAME Stop working

My Iframe has been working for month and now it stop working for past few weeks. When we tested and we got this message. is the CURL link has change or some? please advice


CURL URL

https://scl-sandbox.dev.clover.com/v1/charges


CURL RESPONSE

{

"message": "404 Not Found",

"error": {

"code": "invalid_request",

"message": "Please provide a valid source or token."

}

}


Card No.: 4242 4242 4242 4242

Expiry: 01/2024

CVV: 123

Zip: 123456


CURL POST FIELDS

{

"amount":4000,

"currency":"usd",

"source":"clv_1TSTSB4rdSYzvL2qMPNqpBhz"

}

semi-integrations
10 |2000

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

ubooktoday avatar image
ubooktoday answered
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

This generally happens when there is a mismatch between the owner of the palms key and the access token being used for the charge - e.g. you are using one merchant/apps access token for the PAKMS key retrieval but using a different merchant/apps access token for the charge.

10 |2000

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

ubooktoday avatar image
ubooktoday answered David Marginian Deactivated edited

So right now we have only one APP on our Cloud server. All the merchant share the same APP.

Do we have to create each APP for each merchant?


3 comments
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·
No, but the merchant needs to install your app and you need to obtain an access token on their behalf. The same access token (the one that belongs to the merchant/app) needs to be used to obtain the PAKMS key and for all other API calls.
0 Likes 0 ·
ubooktoday avatar image ubooktoday David Marginian ♦♦ commented ·

Can you see what we did wrong?

Where does they install our APP? in the Clover merchant account?


all steps are same as explained in the below link

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


const clover = new Clover('39c7b87101f44739c823362203d21f89');

This key value are setup in the spa admin panel in clover settings menu

So the App is one but the different spa usese different key


Only difference is the following function

function cloverTokenHandler(token) {}


We are requesting an AJAX for creating a charge


It was working till last week

but now when we are creating a charge it is giving the following response

CURL RESPONSE

{

"message": "404 Not Found",

"error": {

"code": "invalid_request",

"message": "Please provide a valid source or token."

}

}



CURL URL

https://scl-sandbox.dev.clover.com/v1/charges



CURL POST FIELDS

{

"amount":4000,

"currency":"usd",

"source":"clv_1TSTSB4rdSYzvL2qMPNqpBhz"

}

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ ubooktoday commented ·

If you don't understand how a merchant installs your app, how are you obtaining an access token? No, I can't see what you have done wrong, as I said it has to do with you obtaining the PAKMS key with one access token and then making the charge call with another/different access token that does not belong to the merchant/app.

0 Likes 0 ·
ubooktoday avatar image
ubooktoday answered David Marginian Deactivated commented

I go to clover merchant account and click on create token. I also check on E-commerce option And got public keys and private keys.


3 comments
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

The public key is your pakms token, that is the token that should be referenced from the iframe. The private key is the access token which you need to use when you make the charge. The pakms key and access token you use MUST match the merchant you are making charges for. That being said, you should not be using merchant tokens for an integration that supports multiple merchants, that is a violation of our terms.

0 Likes 0 ·
ubooktoday avatar image ubooktoday David Marginian ♦♦ commented ·
So the Auth Token is different, right?
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ ubooktoday commented ·
There is a mismatch, I assume you are getting confused somewhere.
0 Likes 0 ·
ubooktoday avatar image
ubooktoday answered David Marginian Deactivated commented

Also, you point out to me where to use the private key?

Base on this instructions

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

1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

Per my prior comment - "The public key is your pakms token, that is the token that should be referenced from the iframe. The private key is the access token which you need to use when you make the charge call."

0 Likes 0 ·

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