<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadanapay.com/v1/businesses/{businessId}/deposits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => [
'amount' => 10000,
'currency' => 'USD'
],
'idempotencyKey' => 'b6ae5da9-6342-4a58-bd50-8564d68d3f7e',
'externalAccountId' => '8ef9a712-cdae-4110-b1ea-9ba95abbee6e',
'suppressNotification' => false,
'description' => 'April payroll funding',
'payrollId' => '0f3a6c52-8d1e-4b7a-9c2f-5e8d1a4b6c90'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}