From 1ff0203511259c5fa0f50e13a39b8bfae47a05d3 Mon Sep 17 00:00:00 2001 From: xl Date: Mon, 3 Jun 2024 11:41:26 +0800 Subject: [PATCH] eee --- wx/V3/WxV3PaymentNotify.php | 4 ++-- wx/V3/WxV3PaymentTait.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wx/V3/WxV3PaymentNotify.php b/wx/V3/WxV3PaymentNotify.php index 79912bc..8c3ee5f 100644 --- a/wx/V3/WxV3PaymentNotify.php +++ b/wx/V3/WxV3PaymentNotify.php @@ -53,14 +53,14 @@ class WxV3PaymentNotify extends SmallProgram */ public function verify(RequestInterface $request): bool { - $platformPublicKeyInstance = $this->rsaFrom($this->payConfig->pay->wx->mchCert, KEY_TYPE_PUBLIC); + $platformPublicKeyInstance = $this->rsaFrom($this->payConfig->pay->wx->mchKey, KEY_TYPE_PUBLIC); $inWechatpaySignature = $request->getHeaderLine('wechatpay-signature'); // 请根据实际情况获取 $inWechatpayTimestamp = $request->getHeaderLine('wechatpay-timestamp'); // 请根据实际情况获取 $inWechatpayNonce = $request->getHeaderLine('wechatpay-nonce'); // 请根据实际情况获取 $inBody = $request->getBody()->getContents(); // 请根据实际情况获取,例如: file_get_contents('php://input'); $timeOffsetStatus = 300 >= abs(time() - (int)$inWechatpayTimestamp); $verifiedStatus = $this->notifyVerify( - $this->lineFeed([$inWechatpayTimestamp, $inWechatpayNonce, $inBody]), + $this->lineFeed($inWechatpayTimestamp, $inWechatpayNonce, $inBody), $inWechatpaySignature, $platformPublicKeyInstance); if (!$timeOffsetStatus || !$verifiedStatus) { diff --git a/wx/V3/WxV3PaymentTait.php b/wx/V3/WxV3PaymentTait.php index a4b3ca3..037ee91 100644 --- a/wx/V3/WxV3PaymentTait.php +++ b/wx/V3/WxV3PaymentTait.php @@ -137,7 +137,7 @@ trait WxV3PaymentTait { $payConfig = $this->getPayConfig(); - $mch_private_key = openssl_get_privatekey(file_get_contents($payConfig->pay->wx->mchKey)); + $mch_private_key = openssl_get_privatekey(file_get_contents($payConfig->pay->wx->mchCert)); openssl_sign($body, $raw_sign, $mch_private_key, 'sha256WithRSAEncryption'); return base64_encode($raw_sign);