$orderData = [
'userName' => $this->apiUser,
'password' => $this->apiKey,
'shopCode' => $this->shopCode,
];
$orderData['hash'] = $this->generateHash('');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->apiBaseUrl . '/check-balance');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($orderData));
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['SERVER_NAME']);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$resultBody = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($responseArr['status'] == 'success' && isset($responseArr['data']))
{
return [
'status' => 'success',
'message' => 'message',
'data' => [
'blokeli_bakiye'=>$responseArr['data']['blokeli_bakiye'],
'blokesiz_bakiye'=>$responseArr['data']['blokesiz_bakiye'],
],
];
}
else
{
return [
'status' => 'error',
'message' => $responseArr['errorMessage'],
'data' => [],
];
}