payService = $payService; } public function payBefore($platform, $type) { $url=route('test.pay', ['platform'=>$platform, 'type'=>$type]); return <<发起支付 EOT; } public function pay($platform, $type) { $payOrder=new PayOrder(); $payOrder->trade_no=time(); $payOrder->subject="支付测试"; $payOrder->detail="支付测试详情"; $payOrder->price=0.01; $payOrder->callback="App\Services\Common\PayService.testhook"; $payOrder->return_url=route('test.pay.success'); return $this->payService->pay($platform, $type, $payOrder); } public function paySuccess() { return $this->showMessage("支付成功", route('home')); } public function testIP() { var_dump(request()->ip()); var_dump($_SERVER['REMOTE_ADDR']); var_dump(Request::createFromGlobals()->getClientIp()); } }