-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序支付签名问题 #1216
Comments
日志: |
你好!我也遇到这个问题了!请问最后你是怎么解决的呢? |
我用的环境
PHP 版本:7.1
overtrue/wechat 版本:4.0
是否使用了框架?框架名称:laravel5.4
问题及现象
小程序提示错误
return_code: "FAIL", return_msg: "签名错误
小程序代码
wxpay(){
wx.request({
url: getApp().api.get_v3_pay,
header: {
'content-type': 'application/json'
},
data: {
** 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',
];
The text was updated successfully, but these errors were encountered: