Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- //личный пароль мерчанта, полученный им при регистрации, находится в меню настроек мерчанта (Напр: 3A90E5J0f6OUIfqN1Qu59gYrjDgDblfL)
- $password = '';
- //ID мерчанта, зарегистрированного в Приват24.
- $id = 109013;
- // номер карты
- $cardnum = 4130512229858245; //185.28.20.221
- $xml = getBallans($id,$password,$cardnum);
- // получение ьалланса по счету
- // отправляем запрос - $responce сохраняет ответ
- $url = 'https://api.privatbank.ua/p24api/balance';
- $response = sendRequest($url,$xml);
- echo $response;
- function sendRequest($url,$xml) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement