Advertisement
vitvayti

Untitled

Oct 3rd, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <?php
  2. $url = "https://admin.bonus.vtb24.ru:543/NotifyOrderStatus";
  3.  
  4. $cert_file = '/home/bitrix/ext_www/conditions.e-tiketka.com/api/cert/client.crt';
  5. $key_file = '/home/bitrix/ext_www/conditions.e-tiketka.com/api/cert/client.key';
  6.  
  7. //$cert_password = 'nosecure';
  8. $data_string = '<?xml version="1.0" encoding="utf-8"?>
  9. <NotifyOrderStatusMessage xmlns="http://tempuri.org/XMLSchema.xsd">
  10. <Orders>
  11. <Order>
  12. <InternalOrderId>84</InternalOrderId>
  13. <StatusCode>30</StatusCode>
  14. <StatusDateTime>2019-01-01T12:30:00.0</StatusDateTime>
  15. </Order>
  16. </Orders>
  17. </NotifyOrderStatusMessage>';
  18.  
  19. header("Content-type: text/xml; charset=utf-8");
  20. //echo $data_string;
  21. //die();
  22.  
  23. $ch = curl_init();
  24.  
  25. $options = array(
  26. CURLOPT_RETURNTRANSFER => true,
  27. //CURLOPT_HEADER => true,
  28. CURLOPT_FOLLOWLOCATION => true,
  29. CURLOPT_SSL_VERIFYHOST => false,
  30. CURLOPT_SSL_VERIFYPEER => false,
  31. CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
  32. CURLOPT_VERBOSE => true,
  33. CURLOPT_URL => $url ,
  34. CURLOPT_POST => 1,
  35. CURLOPT_CUSTOMREQUEST => 'POST',
  36. CURLOPT_POSTFIELDS => $data_string,
  37. CURLOPT_HTTPHEADER => array('Content-type: application/xml', 'Content-length: '. strlen($data_string)),
  38. CURLOPT_HEADER => true,
  39. CURLOPT_SSLCERT => $cert_file ,
  40. //CURLOPT_SSLCERTPASSWD => $cert_password ,
  41. CURLOPT_SSLKEY => $key_file
  42. );
  43.  
  44. curl_setopt_array($ch, $options);
  45.  
  46. $output = curl_exec($ch);
  47.  
  48. if (!$output) {
  49. echo "Curl Error : " . curl_error($ch);
  50. } else {
  51. echo htmlentities($output);
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement