diff --git a/functions.php b/functions.php index d8bd171..9ff8b31 100644 --- a/functions.php +++ b/functions.php @@ -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; +} \ No newline at end of file