Hi, I am trying to create a charge using
https://docs.clover.com/reference/createcharge.
The request is this
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://scl-sandbox.dev.clover.com/v1/charges', [
'body' => '{"ecomind":"ecom","metadata":{"existingDebtIndicator":false},"amount":25,"currency":"usd","capture":true,"external_reference_id":"9865742","receipt_email":"sherwin@gmail.com","source":"token"}',
'headers' => [
'accept' => 'application/json',
'authorization' => 'Bearer f7f0fake-09ab87-MadeUp-Not-realfd5501c',
'content-type' => 'application/json',
'x-forwarded-for' => 'https%3A%2F%2Fmywebsiteaddresshere.net%2Finterface%2Fmodules%2Fcustom_modules%2Foe-module-clover%2Fpublic%2FpatientPaymentPage.php',
],
]);
echo $response->getBody();
This returns:
{
"message": "400 Bad Request",
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "Please provide a valid source for the charge."
}
}
I tried token "source":"token". That did not work. I tried "alternate_tender"
Did not work.
But from what I am beginning to understand is that this is not for a web only credit card charge.
Am I right?