repository = $repository; $this->agentRepository = $agentRepository; } /** * Common: 获取缴费列表 * Author: wu-hui * Time: 2024/06/17 14:25 * @return mixed */ public function paymentList(){ $config = $this->agentRepository->getConfig(); $paymentList = $config['payment_list'] ?? []; return app('json')->success($paymentList); } /** * Common: 生成缴费记录及订单 * Author: wu-hui * Time: 2024/06/17 18:12 * @return mixed */ public function createOrder(){ // 参数获取 $params = $this->request->params([ ['agent_id', 0], ['money', 0], ['title_quota', 0], ['other_quota', 0], // 支付相关 'pay_type', 'return_url' ]); // 参数判断 if($params['agent_id'] <= 0) throw new ValidateException('身份信息不明确,请重新登录!'); $params['uid'] = $this->request->uid(); $params['user_info'] = $this->request->userInfo(); $params['is_app'] = $this->request->isApp(); $res = $this->repository->createOrder($params); if($res) return $res; else return app('json')->success("操作成功"); } public function paymentRecord(){} }