question

nick-1 avatar image
nick-1 asked David Marginian Deactivated commented

Sandbox - unable to create charge

Hello,

I've used the iframe to create a credit card (clover token), and then that was returned, and I am attempting to a charge, based on the code https://docs.clover.com/docs/using-the-clover-hosted-iframe#creating-a-charge But the PHP Curl call is returning an empty message.

So, I copied the clv_ token into a Bash script, and that then returns an error (as shown below).

Am I doing anything wrong? I have used the Private Token from the Clover eComm Iframe. Ecommerce API token as the authorization: bearer password

I have noticed that the URL to create a charge is scl-sandbox.dev... rather that the URL used to obtain a PAKMS token which is apisandbox.dev... https://docs.clover.com/reference/getapikey

Is there a list of all the endpoints for the APIs?



curl --request POST \
  --url 'https://scl-sandbox.dev.clover.com/v1/charges' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer OBFUSTICATED' \
  --header 'idempotency-key 439de284-b9ab-11ec-acf7-7cd30a704cbc' \
  --header 'content-type: application/json' \
  --data '{"amount":4500,"currency":"usd","source":"clv_1TSTSPM2ujytC4fq3BKqkmoz"}'   

JSON:

{"message":"500 Internal Server Error","error":{"code":"processing_error","message":"Internal Server Error."}}


1649691567371.png

clover developer community
1649691567371.png (19.3 KiB)
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 ·

We have identified the root cause of this issue and are working to resolve it. Once resolved this will also fix your issues with the hosted checkout so you can go back to using that. I will let you know when we have it fixed.

0 Likes 0 ·

1 Answer

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

This was sync issue on our end and has been resolved, you can also use the hosted checkout now if that is what you would prefer.

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

nick-1 avatar image nick-1 commented ·

We'll probably use the iframe integration, as that fits better into the ecommerce flow. But thanks for solving the HPP issue!!

I've managed to get a simple flow working at: http://nick.lms.cm-hosting.com/bluepay/iframe.php

The sequence was to use the Merchant ecommerce api token (ABCDEFG) to generate the PAKMS key, and to then insert that into the new Clover('etcetc'). Use the javascript to capture the clover payment token (clv_123456), and then post a charge (using ABCDEFG)

It seems strange that there are multiple API endpoints (https://apisandbox.dev.clover.com/pakms/apikey to get the PAKMS key, https://checkout.sandbox.dev.clover.com/sdk.js for the iframe javascript and then https://scl-sandbox.dev.clover.com/v1/charges to place the charge).

In production, what would those URLs be set to?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ nick-1 commented ·

I am glad you got everything working, production urls can be found here: https://docs.clover.com/reference/api-reference-overview#production-base-urls and https://docs.clover.com/docs/using-the-clover-hosted-iframe#adding-the-clover-sdk-to-your-webpage. Note, the PAKMS endpoint only needs to be called once per merchant and cached/stored on your end.

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