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']);