微信小程序easywechat支付签名问题

15864490993@163.com

小程序提示错误 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_AEnfI', // 有所修改 'total_fee' => 1, // 总价 ]); // 如果成功生成统一下单的订单,那么进行二次签名 if ($result['return_code'] === 'SUCCESS') { // 二次签名的参数必须与下面相同 $params = [ 'appId' => 'wx001aeca67195585b',//有所修改 '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;
    }

代码不清晰 补一下小程序代码 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: '',
    })

帖子已被锁定,不允许再讨论~