$postData = [
'userName' => $this->apiUser,
'password' => $this->apiKey,
'shopCode' => $this->shopCode,
'withdrawId'=>'',
];
$postData['hash'] = $this->generateHash($postData['withdrawId']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->apiBaseUrl . '/check-withdraw');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));
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'][0]['id']))
{
return [
'status' => 'success',
'message' => 'message',
'data' => [
'id'=>$responseArr['data'][0][id],
'status'=>$responseArr['data'][0][status],
'recipientNameSurname'=>$responseArr['data'][0][recipientNameSurname],
'iban'=>$responseArr['data'][0][iban],
'currency'=>$responseArr['data'][0][currency],
'netAmount'=>$responseArr['data'][0][netAmount],
'processingFee'=>$responseArr['data'][0][processingFee],
'processingFeeCurrency'=>$responseArr['data'][0][processingFeeCurrency],
'registerDate'=>$responseArr['data'][0][registerDate],
'statusChangeDate'=>$responseArr['data'][0][statusChangeDate],
],
];
}
else
{
return [
'status' => 'error',
'message' => $responseArr['errorMessage'],
'data' => [],
];
}