Mình có setup 1 con server check bank Vietcombank, nay có chủ ý muốn cho anh em dùng, ai cần thì xài.
- API do PuaruVN - V4U.VN cung cấp, ai tin tưởng thì dùng, vì phải đấu cả tài khoản và mật khẩu.
- API này có thể ngừng cung cấp, nhưng sẽ thông báo trước.
<?php
$username = "username Vietcombank";
$password = "password Vietcombank";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "9720",
CURLOPT_URL => "http://free.apivcb.live:9720/api/vcb/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\r\n \"begin\": \"".date("d/m/Y")."\",\r\n \"end\": \"".date("d/m/Y")."\",\r\n \"username\": \"".$username."\",\r\n \"password\": \"".$password ."\",\r\n \"accountNumber\": \"\"\r\n}",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>