vitvayti

ReturnClaim 1.25

Jun 8th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $url = "https://85.236.4.226:543/ReturnClaim.ashx";
  2.  
  3. $cert_file = '/home/bitrix/ext_www/stage-01.multibonus.e-tiketka.com/api/cert/test/client.crt';
  4. $key_file = '/home/bitrix/ext_www/stage-01.multibonus.e-tiketka.com/api/cert/test/client.key';
  5. //$cert_password = 'nosecure';
  6.  
  7. $data_string = '<?xml version="1.0" encoding="UTF-8"?>
  8. <ReturnClaimMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="file:/Users/egors/Downloads/ReturnClaimMessage.xsd">
  10. <ReturnClaimId>987654321</ReturnClaimId>
  11. <OrderId>2985336</OrderId>
  12. <FullReturn>false</FullReturn>
  13. <RefundCost>100</RefundCost>
  14. <RefundDetails>
  15.   <RefundDetail>
  16.     <RefundCost>60</RefundCost>
  17.     <Type>OrderItems</Type>
  18.   </RefundDetail>
  19.   <RefundDetail>
  20.     <RefundCost>40</RefundCost>
  21.     <Type>Delivery</Type>
  22.   </RefundDetail>
  23. </RefundDetails>
  24. </ReturnClaimMessage>';
  25.  
  26. //header("Content-type: text/xml; charset=utf-8");
  27. //echo $data_string;
  28. //die();
  29.  
  30. $ch = curl_init();
  31.  
  32. $options = array(
  33.     CURLOPT_RETURNTRANSFER => true,
  34.     //CURLOPT_HEADER => true,
  35.     CURLOPT_FOLLOWLOCATION => true,
  36.     CURLOPT_SSL_VERIFYHOST => false,
  37.     CURLOPT_SSL_VERIFYPEER => false,
  38.     CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
  39.     CURLOPT_VERBOSE => true,
  40.     CURLOPT_URL => $url ,
  41.     CURLOPT_POST => 1,
  42.     CURLOPT_CUSTOMREQUEST => 'POST',
  43.     CURLOPT_POSTFIELDS => $data_string,
  44.     CURLOPT_HTTPHEADER => array('Content-type: application/xml', 'Content-length: '. strlen($data_string)),
  45.     CURLOPT_HEADER => true,
  46.     CURLOPT_SSLCERT => $cert_file ,
  47.     //CURLOPT_SSLCERTPASSWD => $cert_password ,
  48.     CURLOPT_SSLKEY => $key_file
  49. );
  50.  
  51. curl_setopt_array($ch, $options);
  52.  
  53. $output = curl_exec($ch);
  54.  
  55. if (!$output) {
  56.     echo "Curl Error : " . curl_error($ch);
  57. } else {
  58.     echo htmlentities($output);
  59. }
Add Comment
Please, Sign In to add comment