From ca5fe30969a2428a839988a634ed4e9fbe39ede3 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Wed, 20 Nov 2019 19:31:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9B=9E=E8=B0=830.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Callback/Controller/Notify2Controller.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Application/Callback/Controller/Notify2Controller.class.php b/Application/Callback/Controller/Notify2Controller.class.php index d9ae2d8ea..b7f785f2f 100644 --- a/Application/Callback/Controller/Notify2Controller.class.php +++ b/Application/Callback/Controller/Notify2Controller.class.php @@ -38,10 +38,10 @@ class Notify2Controller extends BaseController } Vendor('Alipay.AopSdk'); $aop = new \AopClient(); - $aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt"); - Log::write($aop, Log::DEBUG); - $result = $aop->rsaCheckV2($notify,'','RSA2'); - Log::write(serialize($result), Log::DEBUG); + // $aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt"); + Log::write(file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt"), Log::DEBUG); + $result = $aop->rsaCheckV1($notify,"./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt",'RSA2'); + Log::write($result,Log::DEBUG); if ($result) { //获取回调订单信息 if (I('get.methodtype') == "notify") { From 13700e6123e2bae7e8eaac30070d8da8521f9a4c Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Wed, 20 Nov 2019 19:38:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=9B=9E=E8=B0=830.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Callback/Controller/Notify2Controller.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Application/Callback/Controller/Notify2Controller.class.php b/Application/Callback/Controller/Notify2Controller.class.php index b7f785f2f..946da9702 100644 --- a/Application/Callback/Controller/Notify2Controller.class.php +++ b/Application/Callback/Controller/Notify2Controller.class.php @@ -38,10 +38,12 @@ class Notify2Controller extends BaseController } Vendor('Alipay.AopSdk'); $aop = new \AopClient(); - // $aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt"); - Log::write(file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt"), Log::DEBUG); - $result = $aop->rsaCheckV1($notify,"./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt",'RSA2'); - Log::write($result,Log::DEBUG); + $aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt"); + $result2 = $aop->getSignContent($notify); + + Log::write(json_encode($result2),Log::DEBUG); + $result = $aop->rsaCheckV1($notify,"",'RSA2'); + Log::write(json_encode($result),Log::DEBUG); if ($result) { //获取回调订单信息 if (I('get.methodtype') == "notify") {