From 9d1a70b80be155605934e3f1d555dee0996fb85f Mon Sep 17 00:00:00 2001 From: wuliangbo Date: Mon, 9 Mar 2020 09:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Base/Oauth/Client.php | 11 +++++++++-- src/Kernel/AppClient.php | 9 ++++----- src/Payment/Fund/Client.php | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Base/Oauth/Client.php b/src/Base/Oauth/Client.php index 4b51099..77c29ce 100755 --- a/src/Base/Oauth/Client.php +++ b/src/Base/Oauth/Client.php @@ -5,6 +5,8 @@ namespace EasyAlipay\Base\Oauth; use EasyAlipay\Base\Model\AlipayUserInfoShareReqyest; use EasyAlipay\Kernel\AppClient; use EasyAlipay\Base\Model\AlipaySystemOauthTokenRequest; +use EasyAlipay\Kernel\Exceptions\InvalidSignException; +use function EasyAlipay\Kernel\decrypt; class Client extends AppClient { @@ -47,8 +49,13 @@ class Client extends AppClient return ($this->execute($request)); } - public function decryptData() + /** + * @param $content + * @return false|string + */ + public function decryptData($content) { - + $res = decrypt($content, $this->app->config->get('encrypt_key')); + return $res; } } diff --git a/src/Kernel/AppClient.php b/src/Kernel/AppClient.php index 8609b8d..5d7fe68 100755 --- a/src/Kernel/AppClient.php +++ b/src/Kernel/AppClient.php @@ -19,19 +19,19 @@ class AppClient extends BaseClient * 应用ID * @var string */ - private $appId; + protected $appId; /** * 商户私钥值 * @var string */ - private $rsaPrivateKey; + protected $rsaPrivateKey; /** * 支付宝公钥值 * @var string */ - private $alipayrsaPublicKey; + protected $alipayrsaPublicKey; /** * 支付宝网关 @@ -49,7 +49,7 @@ class AppClient extends BaseClient * 签名类型 * @var string */ - private $signType = "RSA2"; + protected $signType = "RSA2"; /** * 接口版本 @@ -158,7 +158,6 @@ class AppClient extends BaseClient $sysParams["encrypt_type"] = $this->encryptType; $apiParams['biz_content'] = $this->encryptCode($apiParams['biz_content']); } - //签名 $sysParams["sign"] = $this->generateSign(array_merge($apiParams, $sysParams), $this->signType); $requestUrl = $this->buildRequestUrl($sysParams); diff --git a/src/Payment/Fund/Client.php b/src/Payment/Fund/Client.php index 05d5d24..7fee687 100755 --- a/src/Payment/Fund/Client.php +++ b/src/Payment/Fund/Client.php @@ -27,7 +27,7 @@ class Client extends AppClient $productCode = $payload['product_code'] ?? 'TRANS_ACCOUNT_NO_PWD'; $contentBuilder->setProductCode($productCode); if (isset($payload['identity_type'])) { - $contentBuilder->setIdentity($payload['identity_type']); + $contentBuilder->setIdentityType($payload['identity_type']); } if (isset($payload['name'])) { $contentBuilder->setIdentityName($payload['name']);