From e8bd6f3ae047a64fa4d0f71af088ebfb1245e425 Mon Sep 17 00:00:00 2001 From: xl Date: Mon, 13 Nov 2023 22:14:14 +0800 Subject: [PATCH] eee --- wchat/wx/V3/WxV3PaymentNotify.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wchat/wx/V3/WxV3PaymentNotify.php b/wchat/wx/V3/WxV3PaymentNotify.php index 4b98c67..5585d99 100644 --- a/wchat/wx/V3/WxV3PaymentNotify.php +++ b/wchat/wx/V3/WxV3PaymentNotify.php @@ -79,10 +79,11 @@ class WxV3PaymentNotify extends SmallProgram $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); - $lineFeed = $this->lineFeed([$inWechatpayTimestamp, $inWechatpayNonce, $inBody]); - $verifiedStatus = $this->notifyVerify($lineFeed, $inWechatpaySignature, $platformPublicKeyInstance); + $timeOffsetStatus = 300 >= abs(time() - (int)$inWechatpayTimestamp); + $verifiedStatus = $this->notifyVerify( + $this->lineFeed([$inWechatpayTimestamp, $inWechatpayNonce, $inBody]), + $inWechatpaySignature, + $platformPublicKeyInstance); if (!$timeOffsetStatus || !$verifiedStatus) { return false; }