Browse Source

增加手机号解密

master
wuliangbo 5 years ago
parent
commit
9d1a70b80b
  1. 11
      src/Base/Oauth/Client.php
  2. 9
      src/Kernel/AppClient.php
  3. 2
      src/Payment/Fund/Client.php

11
src/Base/Oauth/Client.php

@ -5,6 +5,8 @@ namespace EasyAlipay\Base\Oauth; @@ -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 @@ -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;
}
}

9
src/Kernel/AppClient.php

@ -19,19 +19,19 @@ class AppClient extends BaseClient @@ -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 @@ -49,7 +49,7 @@ class AppClient extends BaseClient
* 签名类型
* @var string
*/
private $signType = "RSA2";
protected $signType = "RSA2";
/**
* 接口版本
@ -158,7 +158,6 @@ class AppClient extends BaseClient @@ -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);

2
src/Payment/Fund/Client.php

@ -27,7 +27,7 @@ class Client extends AppClient @@ -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']);

Loading…
Cancel
Save