Hi, I am wondering how I generate the access token for the charges call to clover.
I have the authorization code public and secret keys, appId and merchant I'd....but not the access token which I believe is needed as the bearer token
Hi, I am wondering how I generate the access token for the charges call to clover.
I have the authorization code public and secret keys, appId and merchant I'd....but not the access token which I believe is needed as the bearer token
Please follow our guide in getting the OAuth 2.0 accessToken / bearer token
https://docs.clover.com/docs/using-oauth-20
Hi , thanks for the quick reply...
I'm using this call here to try get the access token for a production account, is this correct?
The call just returns unknown client id
Are you working with a live merchant and is your app approved?
The customer has a live clover account, I wasn't aware of them having to do anything else on their end.apart from supply the secret key public key and authorization code , we have integrated clover hosted checkout In their website using public key ,so we still need to register an app ?
Ok so the company i work for embeds a ticket sale system onto a clients website.
We have our own payment processor but occasionally a client will want to use a different processor.
In this case the client is looking to use the clover hosted checkout.So in this scenario we integrate the clover hosted checkout into our ticketing system flow in order to take payment at the end.
We had previously done this same thing for a client called lagoon fest in the states, and all worked perfectly, however in that instance the client provided all the keys we needed.
We use the public key to initialize clover object on the frontend javascript like this ..
const clover = new Clover('79ec5af017be0ec*****************');
this allows us to setup the form and a token for the payment
on the server we then just need to make an api call to clover charges endpoint like below.
$url = 'https://scl.clover.com/v1/charges';
curl_setopt_array($Realex_ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{"amount":' . $Clover_Amount . ',"currency":"usd","source":"' . $token . '"}',
CURLOPT_HTTPHEADER => array(
'accept: application/json',
'authorization: Bearer $access_token',
'content-type: application/json'
),
));
The problem im having is the authorization: Bearer code needs to be an access token, and im not sure how to obtain it. As i said i had tried to make a call to the token endpoint using the secret key,appId and auth code but not found
6 People are following this question.