Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = "https://85.236.4.226:543/ReturnClaim.ashx";
- $cert_file = '/home/bitrix/ext_www/stage-01.multibonus.e-tiketka.com/api/cert/test/client.crt';
- $key_file = '/home/bitrix/ext_www/stage-01.multibonus.e-tiketka.com/api/cert/test/client.key';
- //$cert_password = 'nosecure';
- $data_string = '<?xml version="1.0" encoding="UTF-8"?>
- <ReturnClaimMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:/Users/egors/Downloads/ReturnClaimMessage.xsd">
- <ReturnClaimId>987654321</ReturnClaimId>
- <OrderId>2985336</OrderId>
- <FullReturn>false</FullReturn>
- <RefundCost>100</RefundCost>
- <RefundDetails>
- <RefundDetail>
- <RefundCost>60</RefundCost>
- <Type>OrderItems</Type>
- </RefundDetail>
- <RefundDetail>
- <RefundCost>40</RefundCost>
- <Type>Delivery</Type>
- </RefundDetail>
- </RefundDetails>
- </ReturnClaimMessage>';
- //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);
- }
Add Comment
Please, Sign In to add comment