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

关于微信平台公钥证书 #936

Closed
EagriSiol opened this issue Feb 15, 2024 · 1 comment
Closed

关于微信平台公钥证书 #936

EagriSiol opened this issue Feb 15, 2024 · 1 comment

Comments

@EagriSiol
Copy link

包版本号

v3

问题描述

body错误导致 url":"/v3/certificates"}},"message":"错误的签名,验签失败"}

文件

vendor/yansongda/pay/src/Plugin/Wechat/V3/AddPayloadSignaturePlugin.php 68行
get_wechat_body($payload)."\n"; 会返回 一个 [] ."\n"; 这里应该是 空才能正确获取

我修改为 v3/certificates 获取证书时候 body设置为空 其他时候获取body 不然也会导致其他请求失败

    // 修复证书获取签名串中body不为空导致验证失败
    $body = $payload->get('_url') === 'v3/certificates' ? '': get_wechat_body($payload);
    return get_wechat_method($payload)."\n".
        $urlPath.(empty($urlQuery) ? '' : '?'.$urlQuery)."\n".
        $timestamp."\n".
        $random."\n".
        $body."\n";
@yansongda
Copy link
Owner

这个很早以前已经修复了,麻烦查看下 yansongda/artful 的版本是不是最新的 v1.0.9 版本。如果不是,麻烦 composer update

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