diff --git a/FlyCube/Api/Controller/PayController.class.php b/FlyCube/Api/Controller/PayController.class.php index 69fce3b..eb22f76 100644 --- a/FlyCube/Api/Controller/PayController.class.php +++ b/FlyCube/Api/Controller/PayController.class.php @@ -51,8 +51,9 @@ class PayController extends PublicController */ public function pay() { + $order_sn = $_REQUEST['order_sn']; $order = [ - 'out_trade_no' => time() . '', + 'out_trade_no' => $order_sn, 'description' => 'subject-测试', 'amount' => [ 'total' => 1, @@ -65,9 +66,9 @@ class PayController extends PublicController try { $pay = Pay::wechat($this->config)->mini($order); - echo json_encode($pay); + echo json_encode(array('status' => 1, 'payMsg' => $pay)); } catch (\Exception $e) { - echo 'Error: ' . $e->getMessage(); + echo json_encode(array('status' => 0, 'msg' => 'Error: ' . $e->getMessage())); } }