Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($_GET['method'] == 'register')
- {
- if(isset($_GET['amount']) & isset($_GET['guest_name']) & isset($_GET['phone']) & isset($_GET['room']) & isset($_GET['arrival']))
- {
- if(!empty($_GET['amount']) & !empty($_GET['guest_name']) & !empty($_GET['phone']) & !empty($_GET['room']) & !empty($_GET['arrival']))
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $main_server.$register.'?userName='.$merchant['login'].'&password='.$merchant['password'].'&amount='.$_GET['amount'].'&orderNumber='.$orderNumber.'&returnUrl='.$returnUrl);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
- curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Gateway ');
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $data = curl_exec($ch);
- curl_close($ch);
- $data_arr = json_decode($data, true);
- if(isset($data_arr['errorCode']) & !empty($data_arr['errorCode']))
- {
- die('Произошла ошибка: ' . $data_arr['errorCode'] . ' : ' . $data_arr['errorMessage']);
- }
- else
- {
- header("Location: " . $data_arr['formUrl']);
- exit();
- }
- }
- else
- {
- die("Один или несколько параметров пусты");
- }
- }
- else
- {
- die("Один или несколько параметров не заданы");
- }
- }
- error_reporting(E_ALL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement