pay_method; if (count($this->gateway_list) <= 0) { self::addError(['msg' => '通道支付不存在']); } if (!isset($this->gateway_list[$pay_method])) { self::addError(['msg' => '通道支付类型不存在']); } } /** * 支付包配置实列化 * @param $type * @param array $setConfig * @return $this */ public function payConfig($type, $setConfig = []) { $this->pay_config = [ 'username'=>$this->gateway['username'], 'source'=>$this->gateway['source'], 'url'=>$this->gateway['url'], 'thumb'=>$this->gateway['thumb'], 'mch_id'=>$this->gateway['mch_id'] ]; $this->pay_model=$this->pay_config; return $this; } //回调指定通道配置信息gateway public function getConfig($gateway_id, $pay_method) { $this->pay_method = $pay_method; return $this->pay_model = config('gateway.config')[$gateway_id]; } public function getPayConfig() { return $this->pay_config; } public function pay($pay_data) { //订单开始时间,倒计时 $time_only = ((strtotime($this->order->created_at) + $this->timeOut * 60) - time()); $config=config('adconfig.pay_type'); $data = [ 'gateway'=>$this->pay_gateway, 'title' => $config[$this->order->pay_type], 'pay_name' => $config[$this->order->pay_type], 'bank' => $this->pay_gateway, 'order' => $this->order, 'pay_type' => $this->order->pay_type, 'is_mobile' => is_mobile_client(), 'pay_status' => $this->order->pay_status == 1 ? '已支付' : '等待支付', 'only_time' =>$time_only ]; return view('web.order.code', $data); } /* * 验证签名 */ public function verify() { return $this->pay_model->verify(); } public function setLogName($pay_type) { $name = ''; switch ($pay_type) { case 'alipay': $name = 'alipay_'; break; case 'weixin': $name = 'weixin_'; break; } $this->log_name = $name; } public function notify($return = 1, $pay_type, $request) { } public function success() { // TODO: Implement success() method. } }