<?php
$url = 'https://secure.platononline.com/post-balance/';
$data['account_key'] = '*******';
$API_pass = '************';
$data['action'] = 'GET_OPERATION_LIST';
$data['ClientOrderIDrequest_id'] = '235688585';
$data['date'] = '2024-04-17';
$data['hash'] = md5(strtoupper($key.$ClientOrderID.$API_pass)
strtoupper(
$data['request_id'].
$data['account_key']
)
);
$post_data = http_build_query($data);
$headers = [
"Content-Type: application/x-www-form-urlencoded",
"Accept: application/json",
"Content-Length: " . strlen($post_data),
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
if (curl_errno($ch)) {
$error[] = 'CURL ErrorNo: ' . curl_errno($ch);
$error[] = 'CURL Error: ' . curl_error($ch);
$error[] = 'Url: ' . $url;
$error[] = 'Data: ' . var_export($data, true);
echo print_r($error, true);
}
curl_close($ch);
print_r($response); |