Advertisement
Guest User

Untitled

a guest
Apr 9th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. if($_GET['method'] == 'register')
  2. {
  3. if(isset($_GET['amount']) & isset($_GET['guest_name']) & isset($_GET['phone']) & isset($_GET['room']) & isset($_GET['arrival']))
  4. {
  5. if(!empty($_GET['amount']) & !empty($_GET['guest_name']) & !empty($_GET['phone']) & !empty($_GET['room']) & !empty($_GET['arrival']))
  6. {
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL, $main_server.$register.'?userName='.$merchant['login'].'&password='.$merchant['password'].'&amount='.$_GET['amount'].'&orderNumber='.$orderNumber.'&returnUrl='.$returnUrl);
  9. curl_setopt($ch, CURLOPT_HEADER, false);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  11. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  12. curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Gateway ');
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  14. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  15. $data = curl_exec($ch);
  16. curl_close($ch);
  17. $data_arr = json_decode($data, true);
  18.  
  19. if(isset($data_arr['errorCode']) & !empty($data_arr['errorCode']))
  20. {
  21. die('Произошла ошибка: ' . $data_arr['errorCode'] . ' : ' . $data_arr['errorMessage']);
  22. }
  23. else
  24. {
  25. header("Location: " . $data_arr['formUrl']);
  26. exit();
  27. }
  28. }
  29. else
  30. {
  31. die("Один или несколько параметров пусты");
  32. }
  33.  
  34. }
  35. else
  36. {
  37. die("Один или несколько параметров не заданы");
  38. }
  39. }
  40.  
  41. error_reporting(E_ALL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement