question

sanjevan avatar image
sanjevan asked David Marginian Deactivated answered

Remote Pay Cloud giving random error

Im using the semi-integration method using cloud pay. Once I get the token and open the page to list all the devices in my account I'm getting the error

TypeError: Cannot read properties of undefined (reading 'forEach')

when i look at the return call on fetch(`${jPayRemoteCloud.targetCloverDomain}

message: '401 Unauthorized'

but the token and device id all there

why is that?

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.

David Marginian avatar image
David Marginian Deactivated answered

You are making a REST API call to retrieve the devices that belong to a merchant and a receiving a 401, is that an accurate re-statement of the problem? Are you passing the access token in the query string? If so, that is your problem, see -https://community.clover.com/articles/36320/api-authentication-changes-access-token-query-para.html.

10 |2000

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

sanjevan avatar image
sanjevan answered David Marginian Deactivated commented

Thank you for the update. Is there an updated version of the documentation showing the new method?

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.

sanjevan avatar image
sanjevan answered

So, im trying to understand this issue. So in order to get the remote cloud pay working, we used to use query parameter acces_token, now that this has been sunset, we need to generate the access_token using Authorization Bearer header method and then pass it on to the cloud

initialize it in the fetch(`${jPayRemoteCloud.targetCloverDomain}

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

I really don't know where the error is occurring. Please take a look at your browser's console (network tab) and let us know exactly what request is failing. If you ware making an API call (outside of the Remote Pay Cloud SDK) then you need to pass the access token in the header. If you aren't, you need to make sure you update your version of Remote Pay Cloud (see the Remote Pay Cloud section here - https://medium.com/clover-platform-blog/change-is-coming-api-authentication-7d3a85d9abb4).

10 |2000

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

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