payment = $payment; } public function companyBank(){ } public function wechat(){ $payed=Service::checkNotify('wechat'); $data=$payed?$payed->verify():[]; $this->setPayNo($data['transaction_id']??null); return [ $payed!==false, 'success' ]; } protected function setPayNo($no){ $this->payment->pay_no=$no; $this->payment->save(); } public function returnUrl(){ return request()->root(true); } public function alipay(){ $payed=Service::checkNotify('alipay'); $data=$payed?$payed->verify():[]; $this->setPayNo($data['trade_no']??null); return [ $payed!==false, 'success' ]; } public function bankUnion(){ require __DIR__.'/../library/upacp_demo_b2c/sdk/acp_service.php'; $postData=input(); $isPay=AcpService::validate($_POST); $queryPay=UnionQuery::query($postData['orderId'],$this->payment->create_time); $res=[ $isPay && $queryPay, 'success' ]; if($res[0]){ $this->setPayNo($postData['queryId']); } return $res; } public function otherUser(){} public function offline(){} public function process(){ $method=Arr::get(OrderPayService::$methods,$this->payment->pay_type); return App::invokeMethod([$this,$method]); } }