diff --git a/composer.json b/composer.json index 460d46e..97ae12b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "shulidata/easyalipay", + "name": "wuearl/easyalipay", "description": "支付宝SDK", "keywords": [ "alipay", @@ -12,6 +12,7 @@ "php": ">=7.1", "ext-fileinfo": "*", "ext-openssl": "*", + "ext-json": "*", "ext-simplexml": "*", "guzzlehttp/guzzle": "^6.2", "pimple/pimple": "^3.0", diff --git a/src/Base/Model/AlipayUserInfoShareReqyest.php b/src/Base/Model/AlipayUserInfoShareReqyest.php new file mode 100644 index 0000000..16d6b67 --- /dev/null +++ b/src/Base/Model/AlipayUserInfoShareReqyest.php @@ -0,0 +1,14 @@ +setRefreshToken($refresh_token); return ($this->execute($request)); } + + /** + * @param string $token + * @return \EasyAlipay\Kernel\Support\Collection + * @throws \EasyAlipay\Kernel\Exceptions\BadRequestException + * @throws \EasyAlipay\Kernel\Exceptions\InvalidArgumentException + * @throws \EasyAlipay\Kernel\Exceptions\InvalidConfigException + * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException + * @throws \GuzzleHttp\Exception\GuzzleException + */ + public function user(string $token) + { + $this->config['auth_token'] = $token; + $request = new AlipayUserInfoShareReqyest(); + $request->setApiMethodName('alipay.user.info.share'); + return ($this->execute($request)); + } } diff --git a/src/Kernel/AppClient.php b/src/Kernel/AppClient.php index 71323b1..81661e0 100755 --- a/src/Kernel/AppClient.php +++ b/src/Kernel/AppClient.php @@ -152,12 +152,14 @@ class AppClient extends BaseClient throw new InvalidConfigException("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两者不一致!"); } $sysParams = $this->buildParams($request); + //获取业务参数 $apiParams = $request->getApiParas(); if (method_exists($request, "getNeedEncrypt") && $request->getNeedEncrypt()) { $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);