I am facing issue with (401 unauthorized) issue, i am sharing my code
i have tried with code method in app and also testing only method.
i want to capture payment from user and i need a proper documentation for that. The token generated by api is not working i guess. Can anybody check or share php curl code for sample?
Some one suggested me in community clover to delete and recreate app in Web Sandbox dashboard but i cant find option to delete or recreate app for the clover api access.
Its Quite urgent if some one give me a sample code for PHP i need to integrate Clover Payments in my web.
Thanks all.
$data = json_encode(
array(
"orderId" => "1",
"taxAmount" => 9,
"zip" => "94041",
"expMonth" => 1,
"cvv" => "111",
"amount" => 100,
"currency" => "USD",
"last4" => "1111",
"expYear" => 2021,
"first6" => "411111",
"cardEncrypted" => "X8UeKej+AEG1h0wD9Xw=="
)
);
//exit;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://apisandbox.dev.clover.com/v3/merchant/'. $mid .'/pay');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$headers = array();
$headers[] = 'Accept: application/json';
$headers[] = 'Authorization: Bearer 9656dc91-0353-d7d7-30da-bb34ce43f486';
//$headers[] = 'Authorization: Bearer '.$oauth->access_token;
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);