1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\inter\controller;
- use think\Controller;
- use think\Db;
- use think\Session;
- use app\common\library\UUIDs;
- use think\Cache;
- use think\Log;
- use app\common\library\Verify;
- use think\File;
- use app\common\library\send_message;
- use app\common\library\Message;
- class Wechat extends Base {
- public function _initialize() {
- }
- public function wechatCallback() {
- // $param = $_REQUEST['param'];
- Log::record('微信支付回调');
- Log::record('xml');
- $xml = file_get_contents("php://input");
- Log::record($xml);
- Log::record('objectxml');
- $objectxml = simplexml_load_string($xml);//将文件转换成 对象
- Log::record($objectxml);
- Log::record('xmljson');
- $xmljson= json_encode($objectxml );//将对象转换个JSON
- Log::record($xmljson);
- Log::record('xmlarray');
- $xmlarray=json_decode($xmljson,true);//将json转换成数组
- Log::record($xmlarray);
- Log::record('微信支付回调');
- // $order_id = $param['order_id'];
- // $remote_order = DB::table('remote_order')->where('id', $order_id)->find();
- // if(!$remote_order) {
- // return json_encode(['status'=>'fail','code'=>'3001','msg'=> "没有找到该订单"]);
- // }
- // if($remote_order !== Application::ORDER_STATUS['CREATE']) {
- // return json_encode(['status'=>'fail','code'=>'3002','msg'=> "订单状态出错"]);
- // }
- // DB::table('remote_order')->where('id', $order_id)->update(["status" => Application::ORDER_STATUS['PAYCOMPLTET']]);
- // return json_encode(['status'=>'ok','code'=>'0000','msg'=> "支付回调成功"]);
- }
- }
|