diff --git a/functions.php b/functions.php index ed25bb6..5748d5f 100644 --- a/functions.php +++ b/functions.php @@ -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; +}