You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"exception":"[object] (EasyWeChat\\Payment\\Kernel\\Exceptions\\InvalidSignException(code: 0): at /vendor/overtrue/wechat/src/Payment/Notify/Handler.php:183)
翻阅源码发现验签时使用的是 $this->app['config']->key
/**
* Validate the request params.
*
* @param array $message
*
* @throws \EasyWeChat\Payment\Kernel\Exceptions\InvalidSignException
*/
protected function validate(array $message)
{
$sign = $message['sign'];
unset($message['sign']);
if (Support\generate_sign($message, $this->app['config']->key) !== $sign) {
throw new InvalidSignException();
}
}
我用的环境
PHP 版本:7.1
overtrue/wechat 版本:4.0 (3.0下同理)
是否使用了框架?框架名称:Laravel 5.5
问题及现象
使用微信支付沙箱模式进行调试,正确触发微信的回调,但是回调接口抛出异常
"exception":"[object] (EasyWeChat\\Payment\\Kernel\\Exceptions\\InvalidSignException(code: 0): at /vendor/overtrue/wechat/src/Payment/Notify/Handler.php:183)
翻阅源码发现验签时使用的是
$this->app['config']->key
在沙箱模式下,此处应当使用 https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey 请求所获取到的“验收仿真测试系统的API验签密钥”
微信文档:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_1
Thx.
The text was updated successfully, but these errors were encountered: