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

RSA2, Non-certificate mode, The signature is not match,同步异步回调验签失败 #175

Open
ltq918 opened this issue Apr 2, 2020 · 7 comments

Comments

@ltq918
Copy link

ltq918 commented Apr 2, 2020

根据wiki指引,在同步和异步回调时报错 ‘The signature is not match’,最终解决了。
修改 src/Requests/AopNotifyRequest.php

protected function verifySignature(){
        $signer = new Signer($this->params->all());
        $signer->setSort($this->sort);
        $signer->setEncodePolicy($this->encodePolicy);

        $signer->setIgnores(['sign','sign_type']);      //Add this line

        $content = $signer->getContentToSign();
        $sign = $this->params->get('sign');
        $signType = $this->params->get('sign_type');
        if ($signType == 'RSA2') {
            $match = (new Signer)->verifyWithRSA($content, $sign, $this->getAlipayPublicKey(), OPENSSL_ALGO_SHA256);
        } else {
            $match = (new Signer)->verifyWithRSA($content, $sign, $this->getAlipayPublicKey());
        }
        if (! $match) {
            throw new InvalidRequestException('The signature is not match');
        }
    }
@chenxi2015
Copy link

请这个composer包修复了吗?

@ZBrettonYe
Copy link

我也是异步回调的时候出现的问题 ‘The signature is not match’,还重新申请了应用私钥。

使用代码基本安装文档来的应该没有什么问题https://github.com/ZBrettonYe/SSRPanel-OtakuMod/blob/master/app/Http/Controllers/Gateway/AopF2F.php

@ZBrettonYe
Copy link

#143 应该是这个问题

@huiyonghkw
Copy link

huiyonghkw commented May 14, 2020

我也遇到了同样的问题...

之前的项目用的是tag 3.0,整个支付流程是正常的

最近两天更新突然更新了最新版本:3.1,支付OK,不过支付异步回调一直报错:签名不匹配

跟踪了代码,d428c9b

发现很多贡献者也遇到了类似的问题,还做了PR,不过到现在,3.1是不能用的,包括dev-master也不可以用。

另外 3.1 vs 3.0.6 还是有很多调整:v3.0.6...v3.1

于是继续回滚版本到3.0

 "name": "lokielse/omnipay-alipay",
            "version": "v3.0.6",
            "source": {
                "type": "git",
                "url": "https://github.com/lokielse/omnipay-alipay.git",
                "reference": "c1a9cbb242162ac1eb3b069a4eeff6a38235a676"
            },

@Jackfinal
Copy link

友情提示:支付宝 的异步通知地址,不能使用 ”?“传参数,一定要具体的地址,不要用参数,重要的事情说三遍:不要用参数,不要用参数,不要用参数。

@wwnice-max
Copy link

根据wiki指引,在同步和异步回调时报错 ‘The signature is not match’,最终解决了。
修改 src/Requests/AopNotifyRequest.php

protected function verifySignature(){
        $signer = new Signer($this->params->all());
        $signer->setSort($this->sort);
        $signer->setEncodePolicy($this->encodePolicy);

        $signer->setIgnores(['sign','sign_type']);      //Add this line

        $content = $signer->getContentToSign();
        $sign = $this->params->get('sign');
        $signType = $this->params->get('sign_type');
        if ($signType == 'RSA2') {
            $match = (new Signer)->verifyWithRSA($content, $sign, $this->getAlipayPublicKey(), OPENSSL_ALGO_SHA256);
        } else {
            $match = (new Signer)->verifyWithRSA($content, $sign, $this->getAlipayPublicKey());
        }
        if (! $match) {
            throw new InvalidRequestException('The signature is not match');
        }
    }

3.1.2包已经加进去了,但好像还是不行啊

@wwnice-max
Copy link

我也遇到了同样的问题...

之前的项目用的是tag 3.0,整个支付流程是正常的

最近两天更新突然更新了最新版本:3.1,支付OK,不过支付异步回调一直报错:签名不匹配

跟踪了代码,d428c9b

发现很多贡献者也遇到了类似的问题,还做了PR,不过到现在,3.1是不能用的,包括dev-master也不可以用。

另外 3.1 vs 3.0.6 还是有很多调整:v3.0.6...v3.1

于是继续回滚版本到3.0

 "name": "lokielse/omnipay-alipay",
            "version": "v3.0.6",
            "source": {
                "type": "git",
                "url": "https://github.com/lokielse/omnipay-alipay.git",
                "reference": "c1a9cbb242162ac1eb3b069a4eeff6a38235a676"
            },

3.06 也不能用 奇了怪了 看了代码 感觉没什么问题 ,除非是核心加密函数的问题了

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

6 participants