-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
根据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');
}
}
Metadata
Metadata
Assignees
Labels
No labels