Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = "https://admin.bonus.vtb24.ru:543/NotifyOrderStatus";
- $cert_file = '/home/bitrix/ext_www/conditions.e-tiketka.com/api/cert/client.crt';
- $key_file = '/home/bitrix/ext_www/conditions.e-tiketka.com/api/cert/client.key';
- //$cert_password = 'nosecure';
- $data_string = '<?xml version="1.0" encoding="utf-8"?>
- <NotifyOrderStatusMessage xmlns="http://tempuri.org/XMLSchema.xsd">
- <Orders>
- <Order>
- <InternalOrderId>84</InternalOrderId>
- <StatusCode>30</StatusCode>
- <StatusDateTime>2019-01-01T12:30:00.0</StatusDateTime>
- </Order>
- </Orders>
- </NotifyOrderStatusMessage>';
- header("Content-type: text/xml; charset=utf-8");
- //echo $data_string;
- //die();
- $ch = curl_init();
- $options = array(
- CURLOPT_RETURNTRANSFER => true,
- //CURLOPT_HEADER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_SSL_VERIFYHOST => false,
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
- CURLOPT_VERBOSE => true,
- CURLOPT_URL => $url ,
- CURLOPT_POST => 1,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_POSTFIELDS => $data_string,
- CURLOPT_HTTPHEADER => array('Content-type: application/xml', 'Content-length: '. strlen($data_string)),
- CURLOPT_HEADER => true,
- CURLOPT_SSLCERT => $cert_file ,
- //CURLOPT_SSLCERTPASSWD => $cert_password ,
- CURLOPT_SSLKEY => $key_file
- );
- curl_setopt_array($ch, $options);
- $output = curl_exec($ch);
- if (!$output) {
- echo "Curl Error : " . curl_error($ch);
- } else {
- echo htmlentities($output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement