From 37412788257f15d01b224a4a959c068f92e07a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Mon, 11 Aug 2025 16:08:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E5=9B=9E=E8=B0=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Payment.php | 4 ++-- extend/Yzh/YunPay.php | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/application/api/controller/Payment.php b/application/api/controller/Payment.php index 8983fbe..b5728d5 100644 --- a/application/api/controller/Payment.php +++ b/application/api/controller/Payment.php @@ -219,13 +219,13 @@ class Payment extends Controller $yun_pay = new YunPay(); $result = $yun_pay->yun_callback($data,$mess,$timestamp,$sign); if($result['code']==1){ - $data = $result['data']['data']; + $data = $result['data']; if($data){ - $status = $data['status']; if(!isset($data['status'])){ echo 'fail'; die; } + $status = $data['status']; switch ($status){ case "1": // 支付成功(对于支付宝和微信支付是最终状态,对于银行卡大部分情况是终态,小概率会出现"退汇现象",状态由"成功"变为"退汇") diff --git a/extend/Yzh/YunPay.php b/extend/Yzh/YunPay.php index 3646fe4..f023535 100644 --- a/extend/Yzh/YunPay.php +++ b/extend/Yzh/YunPay.php @@ -230,13 +230,14 @@ class YunPay // 异步回调参数 $notifyReq = new NotifyRequest ($data, $mess, $timestamp, $sign) ;// 发起验签解密 try { - $result = $notifyClient->verifyAndDecrypt($notifyReq) ; - Log::record("云账户回调信息".json_encode($result),"info"); - if ($result) { + $result = $notifyClient->verifyAndDescrype($notifyReq) ; + Log::record("云账户回调信息-返回:".json_encode($result),"info"); + $result = json_decode($result,true); + if ($result['signRes']) { // 验签通过、解密成功 - return ['code' => 1, 'msg' => "验签通过、解密成功:", 'data' => $result]; + return ['code' => 1, 'msg' => "验签通过、解密成功:", 'data' => $result['data']]; }else{ - return ['code' => 0, 'msg' => "验签失败", 'data' => null]; + return ['code' => 0, 'msg' => "验签失败", 'data' => $result['data']]; } } catch(Exception $e){