added get payout by Id function

This commit is contained in:
jouls 2024-03-22 14:10:51 +08:00
parent 9d3c301ab5
commit ce9edf6593
1 changed files with 24 additions and 0 deletions

View File

@ -1858,3 +1858,27 @@ function getAllPayout($token)
return $response;
}
function getPayoutById($id, $token)
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/payouts/$id",
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}}',
'Content-Type: application/json',
'Authorization: Bearer ' . $token
),
));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}