added functions for getAllCustomers and getAllVendors

This commit is contained in:
jouls 2024-04-25 15:34:57 +08:00
parent 46995fef7b
commit 35a6c3b693
1 changed files with 45 additions and 0 deletions

View File

@ -2010,3 +2010,48 @@ function updatePayout($token, $payoutId)
return $response;
}
function getAllCustomers ()
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-Api-Key: {{apiKey}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response, true);
return $json;
}
function getAllVendors ()
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-Api-Key: {{apiKey}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response, true);
return $json;
}