Skip to content
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

微信小程序获取接收回调,提示无效签名 #724

Closed
yearspark opened this issue Dec 19, 2022 · 0 comments
Closed

微信小程序获取接收回调,提示无效签名 #724

yearspark opened this issue Dec 19, 2022 · 0 comments

Comments

@yearspark
Copy link

yearspark commented Dec 19, 2022

包版本号

V3

问题描述

按照文档要求,填写完参数后,支付是没问问题的,但是接收回调报错了

你的代码

$this->config=[
'wechat'=>[
'default'=>[
// 必填-商户号,服务商模式下为服务商商户号
// 可在 https://pay.weixin.qq.com/ 账户中心->商户信息 查看
'mch_id'=>'1635******',
// 必填-商户秘钥
// 即 API v3 密钥(32字节,形如md5值),可在 账户中心->API安全 中设置
'mch_secret_key'=>'a4ef6c30a1e643**',
// 必填-商户私钥 字符串或路径
// 即 API证书 PRIVATE KEY,可在 账户中心->API安全->申请API证书 里获得
// 文件名形如:apiclient_key.pem
'mch_secret_cert'=>'cert/apiclient_key.pem',
// 必填-商户公钥证书路径
// 即 API证书 CERTIFICATE,可在 账户中心->API安全->申请API证书 里获得
// 文件名形如:apiclient_cert.pem
'mch_public_cert_path'=>'cert/apiclient_cert.pem',
// 必填-微信回调url
// 不能有参数,如?号,空格等,否则会无法正确回调
'notify_url'=>'https://www.xxxx/order/notice',
// 选填-公众号 的 app_id
// 可在 mp.weixin.qq.com 设置与开发->基本配置->开发者ID(AppID) 查看
// 'mp_app_id'=>'2016082000291234',
// 选填-小程序 的 app_id
'mini_app_id'=>$this->appid,
// 选填-app 的 app_id
// 'app_id'=>'',
// 选填-合单 app_id
// 'combine_app_id'=>'',
// 选填-合单商户号
// 'combine_mch_id'=>'',
// 选填-服务商模式下,子公众号 的 app_id
// 'sub_mp_app_id'=>'',
// 选填-服务商模式下,子 app 的 app_id
// 'sub_app_id'=>'',
// 选填-服务商模式下,子小程序 的 app_id
// 'sub_mini_app_id'=>'',
// 选填-服务商模式下,子商户id
// 'sub_mch_id'=>'',
// 选填-微信平台公钥证书路径, optional,强烈建议 php-fpm 模式下配置此参数
// 前面是证书序列号,后面是通过CertificateDownloader.php生成的
'wechat_public_cert_path'=>[
'A50704F9844FE6A673FD'=>'cert/wechatpay_861FC4F0C6D78FE76453.pem',
],
// 选填-默认为正常模式。可选为:MODE_NORMAL, MODE_SERVICE
'mode'=>Pay::MODE_NORMAL,
]
],
];

// 接收通知
public function notice()
{

	Pay::config($this->config);
	$result=Pay::wechat()->callback();
}

报错详情

[5003]InvalidResponseException in Functions.php line 171

if (empty($sign)) {
throw new InvalidResponseException(Exception::INVALID_RESPONSE_SIGN, '', ['headers' => $message->getHeaders(), 'body' => $body]);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants