Wechat.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\inter\controller;
  3. use think\Controller;
  4. use think\Db;
  5. use think\Session;
  6. use app\common\library\UUIDs;
  7. use think\Cache;
  8. use think\Log;
  9. use app\common\library\Verify;
  10. use think\File;
  11. use app\common\library\send_message;
  12. use app\common\library\Message;
  13. class Wechat extends Base {
  14. public function _initialize() {
  15. }
  16. public function wechatCallback() {
  17. // $param = $_REQUEST['param'];
  18. Log::record('微信支付回调');
  19. $res = file_get_contents("php://input");
  20. $xml = simplexml_load_file($res);
  21. $data = json_decode(json_encode($xml),TRUE);
  22. json_decode($data);
  23. Log::record('微信支付回调');
  24. // $order_id = $param['order_id'];
  25. // $remote_order = DB::table('remote_order')->where('id', $order_id)->find();
  26. // if(!$remote_order) {
  27. // return json_encode(['status'=>'fail','code'=>'3001','msg'=> "没有找到该订单"]);
  28. // }
  29. // if($remote_order !== Application::ORDER_STATUS['CREATE']) {
  30. // return json_encode(['status'=>'fail','code'=>'3002','msg'=> "订单状态出错"]);
  31. // }
  32. // DB::table('remote_order')->where('id', $order_id)->update(["status" => Application::ORDER_STATUS['PAYCOMPLTET']]);
  33. // return json_encode(['status'=>'ok','code'=>'0000','msg'=> "支付回调成功"]);
  34. }
  35. }