微信小程序easywechat支付签名

15864490993@163.com

微信小程序返回错误:data:{return_code: "FAIL", return_msg: "签名错误"} 微信小程序端代码:

 wxpay(){
    wx.request({
      url: getApp().api.get_v3_pay,
      header: {
        'content-type': 'application/json'
      },
      data: {

      }, success: res => {
        console.log(res)
        wx.requestPayment({
          timeStamp: '',
          nonceStr: '',
          package: '',
          signType: '',
          paySign: '',
        })

laravel端代码

 public function pay(){
        $payment = \EasyWeChat::payment(); // 微信支付
        $result = $payment->order->unify([
            'body'         => '测试支付',
            'out_trade_no' => '263565',
            'trade_type'   => 'JSAPI',  // 必须为JSAPI
            'openid'       => 'oRHbw0Fsrlvpr_AEnf0Lg8', //有所修改
            'total_fee'    => 1, // 总价
        ]);

// 如果成功生成统一下单的订单,那么进行二次签名
        if ($result['return_code'] === 'SUCCESS') {
            // 二次签名的参数必须与下面相同
            $params = [
                'appId'     => 'wx001aeca67195',//有所修改
                'timeStamp' => time(),
                'nonceStr'  => $result['nonce_str'],
                'package'   => 'prepay_id=' . $result['prepay_id'],
                'signType'  => 'MD5',
            ];

            // config('wechat.payment.default.key')为商户的key
            $params['paySign'] = generate_sign($params, config('wechat.payment.default.key'));

            return  $params;
        } else {

         return $result;
        }

    }

日志: [2018-05-13 23:19:45] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function wx_user() on boolean in /www/sddy/app/Http/Controllers/Api/V3/UserController.php:36 Stack trace:

0 [internal function]: App\Http\Controllers\Api\V3\UserController->pay() 1 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(55): call_user_func_array(Array, Array) 2 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction('pay', Array) 3 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Api\V3\UserController), 'pay') 4 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Route.php(160): Illuminate\Routing\Route->runController() 5 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Router.php(572): Illuminate\Routing\Route->run() 6 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Dingo\Api\Http\Request)) 7 /www/sddy/vendor/dingo/api/src/Http/Middleware/PrepareController.php(45): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Dingo\Api\Http\Request)) 8 /www/sddy/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Dingo\Api\Http\Middleware\PrepareController->handle(Object(Dingo\Api\Http\Request), Object(Closure)) 9 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Dingo\Api\Http\Request)) 10 /www/sddy/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Dingo\Api\Http\Request)) 11 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Router.php(574): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 12 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Router.php(533): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Dingo\Api\Http\Request)) 13 /www/sddy/vendor/laravel/framework/src/Illuminate/Routing/Router.php(511): Illuminate\Routing\Router->dispatchToRoute(Object(Dingo\Api\Http\Request)) 14 /www/sddy/vendor/dingo/api/src/Routing/Adapter/Laravel.php(81): Illuminate\Routing\Router->dispatch(Object(Dingo\Api\Http\Request)) 15 /www/sddy/vendor/dingo/api/src/Routing/Router.php(513): Dingo\Api\Routing\Adapter\Laravel->dispatch(Object(Dingo\Api\Http\Request), 'v1') 16 /www/sddy/vendor/dingo/api/src/Http/Middleware/Request.php(126): Dingo\Api\Routing\Router->dispatch(Object(Dingo\Api\Http\Request))

Call to a member function wx_user() on boolean 这么明显的问题。。。