From ce9edf65938481c228c25f54d91f1226eede3fe4 Mon Sep 17 00:00:00 2001 From: jouls Date: Fri, 22 Mar 2024 14:10:51 +0800 Subject: [PATCH] added get payout by Id function --- functions.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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; +}