question

thedangler avatar image
thedangler asked David Marginian Deactivated commented

No Such Key when initializing iframe js with correct key

I'm following the iframe instructions.<head> ... <script src="https://checkout.sandbox.dev.clover.com/sdk.js"></script>; </head>

placed

const clover = new Clover('my_key');

const elements = clover.elements();


in script takes after my div for the iframe.

I verified that my_token is there and it correct by using "https://docs.clover.com/reference/getapikey"

to generate it.

But when I load the page i get an error message in the console.

https://checkout.sandbox.dev.clover.com/sdk.js.map

<Error>
<Code>NoSuchKey</Code><Message>The specified key does not exist.</Message>
</Error>


Please advise.


clover developer community
10 |2000

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

1 Answer

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

Are you sure you generated the token sandbox?

6 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.

thedangler avatar image thedangler commented ·

Yes.

I go here:

https://docs.clover.com/reference/getapikey

Put in the bearer.

I copy it
place it in.

I did notice in firefox and chrome I get this error

Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”).

Don't know if that has anything to do with it..


In case you dont believe me here is the pakms result request.


{

"apiAccessKey": "7af85e7d9d7351d9ecxxxxxxxxx",

"merchantUuid": "RKxxxxxxx",

"developerAppUuid": "Txxxxxxxx",

"active": true,

"createdTime": 1642476279000,

"modifiedTime": 1642476279000

}



0 Likes 0 ·
thedangler avatar image thedangler commented ·

Interesting enough

soon as I add

<script src="https://checkout.sandbox.dev.clover.com/sdk.js"></script>

To my head I get the error. new Clover('key'); isn't causing it.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ thedangler commented ·
0 Likes 0 ·
thedangler avatar image thedangler David Marginian ♦♦ commented ·
So strange loading javascript outside of <html> blocks?
0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community