eee
This commit is contained in:
@@ -53,7 +53,7 @@ class WxV3PaymentNotify extends SmallProgram
|
|||||||
*/
|
*/
|
||||||
public function verify(RequestInterface $request): bool
|
public function verify(RequestInterface $request): bool
|
||||||
{
|
{
|
||||||
$platformPublicKeyInstance = $this->rsaFrom($this->payConfig->pay->wx->mchKey, KEY_TYPE_PUBLIC);
|
$platformPublicKeyInstance = $this->rsaFrom($this->payConfig->pay->wx->mchCert, KEY_TYPE_PUBLIC);
|
||||||
$inWechatpaySignature = $request->getHeaderLine('Wechatpay-Signature'); // 请根据实际情况获取
|
$inWechatpaySignature = $request->getHeaderLine('Wechatpay-Signature'); // 请根据实际情况获取
|
||||||
$inWechatpayTimestamp = $request->getHeaderLine('Wechatpay-Timestamp'); // 请根据实际情况获取
|
$inWechatpayTimestamp = $request->getHeaderLine('Wechatpay-Timestamp'); // 请根据实际情况获取
|
||||||
$inWechatpayNonce = $request->getHeaderLine('Wechatpay-Nonce'); // 请根据实际情况获取
|
$inWechatpayNonce = $request->getHeaderLine('Wechatpay-Nonce'); // 请根据实际情况获取
|
||||||
@@ -111,7 +111,7 @@ class WxV3PaymentNotify extends SmallProgram
|
|||||||
*/
|
*/
|
||||||
protected function rsaFrom(string $thing, string $type = KEY_TYPE_PRIVATE): OpenSSLAsymmetricKey
|
protected function rsaFrom(string $thing, string $type = KEY_TYPE_PRIVATE): OpenSSLAsymmetricKey
|
||||||
{
|
{
|
||||||
$pkey = (($isPublic = $type === KEY_TYPE_PUBLIC) ? openssl_pkey_get_public('file:/' . $thing) : openssl_pkey_get_private('file:/' . $thing));
|
$pkey = (($isPublic = $type === KEY_TYPE_PUBLIC) ? openssl_pkey_get_public('file://' . $thing) : openssl_pkey_get_private('file://' . $thing));
|
||||||
if (false === $pkey) {
|
if (false === $pkey) {
|
||||||
throw new \UnexpectedValueException(sprintf('Cannot load %s from(%s), please take care about the $thing input.', $isPublic ? 'publicKey' : 'privateKey', gettype($thing)));
|
throw new \UnexpectedValueException(sprintf('Cannot load %s from(%s), please take care about the $thing input.', $isPublic ? 'publicKey' : 'privateKey', gettype($thing)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user