|
- <?php
- ini_set('date.timezone','Asia/Shanghai');
- require_once '../wechat/Common/Function.php';
- $postStr = file_get_contents("php://input");
- success_notify(json_encode($postStr));
- if (!empty($postStr)){
- libxml_disable_entity_loader(true);
- $dataArray= (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
- foreach ($dataArray as $key=>$v){
- success_notify($key."--".$v);
- }
- $ordernoArr=$dataArray['out_trade_no'];
- $ordernoArray=explode('-', $ordernoArr);
- $orderno=$ordernoArray[0];
- success_notify($orderno);
- $url="http://xmwxc.zhizhuchuxing.cn/fx/order_confirm.php?orderno=".$orderno;
- $result=http_request($url);
- success_notify($url."--".$result.'--'.json_encode($result));
- $xml="<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
- echo $xml;
- }
- function success_notify($result){
- file_put_contents('./success_notify.txt', date("Y-m-d H:i:s")." ".$result.PHP_EOL,FILE_APPEND);//订单成功后通知后台日志
- }
|