初始化仓库
This commit is contained in:
198
vendor/alipaysdk/easysdk/php/src/Base/Image/Client.php
vendored
Normal file
198
vendor/alipaysdk/easysdk/php/src/Base/Image/Client.php
vendored
Normal file
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\Image;
|
||||
|
||||
use Alipay\EasySDK\Kernel\EasySDKKernel;
|
||||
use AlibabaCloud\Tea\Tea;
|
||||
use AlibabaCloud\Tea\Request;
|
||||
use AlibabaCloud\Tea\Exception\TeaError;
|
||||
use \Exception;
|
||||
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;
|
||||
|
||||
use Alipay\EasySDK\Base\Image\Models\AlipayOfflineMaterialImageUploadResponse;
|
||||
use AlibabaCloud\Tea\Response;
|
||||
|
||||
class Client {
|
||||
protected $_kernel;
|
||||
|
||||
public function __construct($kernel){
|
||||
$this->_kernel = $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $imageName
|
||||
* @param string $imageFilePath
|
||||
* @return AlipayOfflineMaterialImageUploadResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function upload($imageName, $imageFilePath){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 100000,
|
||||
"readTimeout" => 100000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.offline.material.image.upload",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [];
|
||||
$textParams = [
|
||||
"image_type" => "jpg",
|
||||
"image_name" => $imageName
|
||||
];
|
||||
$fileParams = [
|
||||
"image_content" => $imageFilePath
|
||||
];
|
||||
$boundary = $this->_kernel->getRandomBoundary();
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => $this->_kernel->concatStr("multipart/form-data;charset=utf-8;boundary=", $boundary)
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams));
|
||||
$_request->body = $this->_kernel->toMultipartRequestBody($textParams, $fileParams, $boundary);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.offline.material.image.upload");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipayOfflineMaterialImageUploadResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipayOfflineMaterialImageUploadResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISV代商户代用,指定appAuthToken
|
||||
*
|
||||
* @param $appAuthToken String 代调用token
|
||||
* @return $this 本客户端,便于链式调用
|
||||
*/
|
||||
public function agent($appAuthToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("app_auth_token", $appAuthToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权调用,指定authToken
|
||||
*
|
||||
* @param $authToken String 用户授权token
|
||||
* @return $this
|
||||
*/
|
||||
public function auth($authToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("auth_token", $authToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
*
|
||||
* @param $url String 异步通知回调地址,例如:https://www.test.com/callback
|
||||
* @return $this
|
||||
*/
|
||||
public function asyncNotify($url)
|
||||
{
|
||||
$this->_kernel->injectTextParam("notify_url", $url);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
*
|
||||
* @param $testUrl String 后端系统测试地址
|
||||
* @return $this
|
||||
*/
|
||||
public function route($testUrl)
|
||||
{
|
||||
$this->_kernel->injectTextParam("ws_service_url", $testUrl);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
*
|
||||
* @param $key String 业务请求参数名称(biz_content下的字段名,比如timeout_express)
|
||||
* @param $value object 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
* 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用String储存
|
||||
* 如果该字段是一个数值型类型(比如:Number),请使用Long储存
|
||||
* 如果该字段是一个复杂类型,请使用嵌套的array指定各下级字段的值
|
||||
* 如果该字段是一个数组,请使用array储存各个值
|
||||
* @return $this
|
||||
*/
|
||||
public function optional($key, $value)
|
||||
{
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
* optional方法的批量版本
|
||||
*
|
||||
* @param $optionalArgs array 可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释
|
||||
* @return $this
|
||||
*/
|
||||
public function batchOptional($optionalArgs)
|
||||
{
|
||||
foreach ($optionalArgs as $key => $value) {
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
117
vendor/alipaysdk/easysdk/php/src/Base/Image/Models/AlipayOfflineMaterialImageUploadResponse.php
vendored
Normal file
117
vendor/alipaysdk/easysdk/php/src/Base/Image/Models/AlipayOfflineMaterialImageUploadResponse.php
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\Image\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class AlipayOfflineMaterialImageUploadResponse extends Model {
|
||||
protected $_name = [
|
||||
'httpBody' => 'http_body',
|
||||
'code' => 'code',
|
||||
'msg' => 'msg',
|
||||
'subCode' => 'sub_code',
|
||||
'subMsg' => 'sub_msg',
|
||||
'imageId' => 'image_id',
|
||||
'imageUrl' => 'image_url',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('httpBody', $this->httpBody, true);
|
||||
Model::validateRequired('code', $this->code, true);
|
||||
Model::validateRequired('msg', $this->msg, true);
|
||||
Model::validateRequired('subCode', $this->subCode, true);
|
||||
Model::validateRequired('subMsg', $this->subMsg, true);
|
||||
Model::validateRequired('imageId', $this->imageId, true);
|
||||
Model::validateRequired('imageUrl', $this->imageUrl, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->httpBody) {
|
||||
$res['http_body'] = $this->httpBody;
|
||||
}
|
||||
if (null !== $this->code) {
|
||||
$res['code'] = $this->code;
|
||||
}
|
||||
if (null !== $this->msg) {
|
||||
$res['msg'] = $this->msg;
|
||||
}
|
||||
if (null !== $this->subCode) {
|
||||
$res['sub_code'] = $this->subCode;
|
||||
}
|
||||
if (null !== $this->subMsg) {
|
||||
$res['sub_msg'] = $this->subMsg;
|
||||
}
|
||||
if (null !== $this->imageId) {
|
||||
$res['image_id'] = $this->imageId;
|
||||
}
|
||||
if (null !== $this->imageUrl) {
|
||||
$res['image_url'] = $this->imageUrl;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return AlipayOfflineMaterialImageUploadResponse
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['http_body'])){
|
||||
$model->httpBody = $map['http_body'];
|
||||
}
|
||||
if(isset($map['code'])){
|
||||
$model->code = $map['code'];
|
||||
}
|
||||
if(isset($map['msg'])){
|
||||
$model->msg = $map['msg'];
|
||||
}
|
||||
if(isset($map['sub_code'])){
|
||||
$model->subCode = $map['sub_code'];
|
||||
}
|
||||
if(isset($map['sub_msg'])){
|
||||
$model->subMsg = $map['sub_msg'];
|
||||
}
|
||||
if(isset($map['image_id'])){
|
||||
$model->imageId = $map['image_id'];
|
||||
}
|
||||
if(isset($map['image_url'])){
|
||||
$model->imageUrl = $map['image_url'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description 响应原始字符串
|
||||
* @var string
|
||||
*/
|
||||
public $httpBody;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $msg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subMsg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $imageId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $imageUrl;
|
||||
|
||||
}
|
||||
283
vendor/alipaysdk/easysdk/php/src/Base/OAuth/Client.php
vendored
Normal file
283
vendor/alipaysdk/easysdk/php/src/Base/OAuth/Client.php
vendored
Normal file
@ -0,0 +1,283 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\OAuth;
|
||||
|
||||
use Alipay\EasySDK\Kernel\EasySDKKernel;
|
||||
use AlibabaCloud\Tea\Tea;
|
||||
use AlibabaCloud\Tea\Request;
|
||||
use AlibabaCloud\Tea\Exception\TeaError;
|
||||
use \Exception;
|
||||
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;
|
||||
|
||||
use Alipay\EasySDK\Base\OAuth\Models\AlipaySystemOauthTokenResponse;
|
||||
use AlibabaCloud\Tea\Response;
|
||||
|
||||
class Client {
|
||||
protected $_kernel;
|
||||
|
||||
public function __construct($kernel){
|
||||
$this->_kernel = $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @return AlipaySystemOauthTokenResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function getToken($code){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 15000,
|
||||
"readTimeout" => 15000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.system.oauth.token",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [];
|
||||
$textParams = [
|
||||
"grant_type" => "authorization_code",
|
||||
"code" => $code
|
||||
];
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => "application/x-www-form-urlencoded;charset=utf-8"
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams, $textParams));
|
||||
$_request->body = $this->_kernel->toUrlEncodedRequestBody($bizParams);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.system.oauth.token");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipaySystemOauthTokenResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipaySystemOauthTokenResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $refreshToken
|
||||
* @return AlipaySystemOauthTokenResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function refreshToken($refreshToken){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 15000,
|
||||
"readTimeout" => 15000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.system.oauth.token",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [];
|
||||
$textParams = [
|
||||
"grant_type" => "refresh_token",
|
||||
"refresh_token" => $refreshToken
|
||||
];
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => "application/x-www-form-urlencoded;charset=utf-8"
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams, $textParams));
|
||||
$_request->body = $this->_kernel->toUrlEncodedRequestBody($bizParams);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.system.oauth.token");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipaySystemOauthTokenResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipaySystemOauthTokenResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISV代商户代用,指定appAuthToken
|
||||
*
|
||||
* @param $appAuthToken String 代调用token
|
||||
* @return $this 本客户端,便于链式调用
|
||||
*/
|
||||
public function agent($appAuthToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("app_auth_token", $appAuthToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权调用,指定authToken
|
||||
*
|
||||
* @param $authToken String 用户授权token
|
||||
* @return $this
|
||||
*/
|
||||
public function auth($authToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("auth_token", $authToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
*
|
||||
* @param $url String 异步通知回调地址,例如:https://www.test.com/callback
|
||||
* @return $this
|
||||
*/
|
||||
public function asyncNotify($url)
|
||||
{
|
||||
$this->_kernel->injectTextParam("notify_url", $url);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
*
|
||||
* @param $testUrl String 后端系统测试地址
|
||||
* @return $this
|
||||
*/
|
||||
public function route($testUrl)
|
||||
{
|
||||
$this->_kernel->injectTextParam("ws_service_url", $testUrl);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
*
|
||||
* @param $key String 业务请求参数名称(biz_content下的字段名,比如timeout_express)
|
||||
* @param $value object 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
* 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用String储存
|
||||
* 如果该字段是一个数值型类型(比如:Number),请使用Long储存
|
||||
* 如果该字段是一个复杂类型,请使用嵌套的array指定各下级字段的值
|
||||
* 如果该字段是一个数组,请使用array储存各个值
|
||||
* @return $this
|
||||
*/
|
||||
public function optional($key, $value)
|
||||
{
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
* optional方法的批量版本
|
||||
*
|
||||
* @param $optionalArgs array 可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释
|
||||
* @return $this
|
||||
*/
|
||||
public function batchOptional($optionalArgs)
|
||||
{
|
||||
foreach ($optionalArgs as $key => $value) {
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
156
vendor/alipaysdk/easysdk/php/src/Base/OAuth/Models/AlipaySystemOauthTokenResponse.php
vendored
Normal file
156
vendor/alipaysdk/easysdk/php/src/Base/OAuth/Models/AlipaySystemOauthTokenResponse.php
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\OAuth\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class AlipaySystemOauthTokenResponse extends Model {
|
||||
protected $_name = [
|
||||
'httpBody' => 'http_body',
|
||||
'code' => 'code',
|
||||
'msg' => 'msg',
|
||||
'subCode' => 'sub_code',
|
||||
'subMsg' => 'sub_msg',
|
||||
'userId' => 'user_id',
|
||||
'accessToken' => 'access_token',
|
||||
'expiresIn' => 'expires_in',
|
||||
'refreshToken' => 'refresh_token',
|
||||
'reExpiresIn' => 're_expires_in',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('httpBody', $this->httpBody, true);
|
||||
Model::validateRequired('code', $this->code, true);
|
||||
Model::validateRequired('msg', $this->msg, true);
|
||||
Model::validateRequired('subCode', $this->subCode, true);
|
||||
Model::validateRequired('subMsg', $this->subMsg, true);
|
||||
Model::validateRequired('userId', $this->userId, true);
|
||||
Model::validateRequired('accessToken', $this->accessToken, true);
|
||||
Model::validateRequired('expiresIn', $this->expiresIn, true);
|
||||
Model::validateRequired('refreshToken', $this->refreshToken, true);
|
||||
Model::validateRequired('reExpiresIn', $this->reExpiresIn, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->httpBody) {
|
||||
$res['http_body'] = $this->httpBody;
|
||||
}
|
||||
if (null !== $this->code) {
|
||||
$res['code'] = $this->code;
|
||||
}
|
||||
if (null !== $this->msg) {
|
||||
$res['msg'] = $this->msg;
|
||||
}
|
||||
if (null !== $this->subCode) {
|
||||
$res['sub_code'] = $this->subCode;
|
||||
}
|
||||
if (null !== $this->subMsg) {
|
||||
$res['sub_msg'] = $this->subMsg;
|
||||
}
|
||||
if (null !== $this->userId) {
|
||||
$res['user_id'] = $this->userId;
|
||||
}
|
||||
if (null !== $this->accessToken) {
|
||||
$res['access_token'] = $this->accessToken;
|
||||
}
|
||||
if (null !== $this->expiresIn) {
|
||||
$res['expires_in'] = $this->expiresIn;
|
||||
}
|
||||
if (null !== $this->refreshToken) {
|
||||
$res['refresh_token'] = $this->refreshToken;
|
||||
}
|
||||
if (null !== $this->reExpiresIn) {
|
||||
$res['re_expires_in'] = $this->reExpiresIn;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return AlipaySystemOauthTokenResponse
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['http_body'])){
|
||||
$model->httpBody = $map['http_body'];
|
||||
}
|
||||
if(isset($map['code'])){
|
||||
$model->code = $map['code'];
|
||||
}
|
||||
if(isset($map['msg'])){
|
||||
$model->msg = $map['msg'];
|
||||
}
|
||||
if(isset($map['sub_code'])){
|
||||
$model->subCode = $map['sub_code'];
|
||||
}
|
||||
if(isset($map['sub_msg'])){
|
||||
$model->subMsg = $map['sub_msg'];
|
||||
}
|
||||
if(isset($map['user_id'])){
|
||||
$model->userId = $map['user_id'];
|
||||
}
|
||||
if(isset($map['access_token'])){
|
||||
$model->accessToken = $map['access_token'];
|
||||
}
|
||||
if(isset($map['expires_in'])){
|
||||
$model->expiresIn = $map['expires_in'];
|
||||
}
|
||||
if(isset($map['refresh_token'])){
|
||||
$model->refreshToken = $map['refresh_token'];
|
||||
}
|
||||
if(isset($map['re_expires_in'])){
|
||||
$model->reExpiresIn = $map['re_expires_in'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description 响应原始字符串
|
||||
* @var string
|
||||
*/
|
||||
public $httpBody;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $msg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subMsg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $userId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $accessToken;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $expiresIn;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $refreshToken;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $reExpiresIn;
|
||||
|
||||
}
|
||||
196
vendor/alipaysdk/easysdk/php/src/Base/Qrcode/Client.php
vendored
Normal file
196
vendor/alipaysdk/easysdk/php/src/Base/Qrcode/Client.php
vendored
Normal file
@ -0,0 +1,196 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\Qrcode;
|
||||
|
||||
use Alipay\EasySDK\Kernel\EasySDKKernel;
|
||||
use AlibabaCloud\Tea\Tea;
|
||||
use AlibabaCloud\Tea\Request;
|
||||
use AlibabaCloud\Tea\Exception\TeaError;
|
||||
use \Exception;
|
||||
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;
|
||||
|
||||
use Alipay\EasySDK\Base\Qrcode\Models\AlipayOpenAppQrcodeCreateResponse;
|
||||
use AlibabaCloud\Tea\Response;
|
||||
|
||||
class Client {
|
||||
protected $_kernel;
|
||||
|
||||
public function __construct($kernel){
|
||||
$this->_kernel = $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $urlParam
|
||||
* @param string $queryParam
|
||||
* @param string $describe
|
||||
* @return AlipayOpenAppQrcodeCreateResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function create($urlParam, $queryParam, $describe){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 15000,
|
||||
"readTimeout" => 15000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.open.app.qrcode.create",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [
|
||||
"url_param" => $urlParam,
|
||||
"query_param" => $queryParam,
|
||||
"describe" => $describe
|
||||
];
|
||||
$textParams = [];
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => "application/x-www-form-urlencoded;charset=utf-8"
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams, $textParams));
|
||||
$_request->body = $this->_kernel->toUrlEncodedRequestBody($bizParams);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.open.app.qrcode.create");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipayOpenAppQrcodeCreateResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipayOpenAppQrcodeCreateResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISV代商户代用,指定appAuthToken
|
||||
*
|
||||
* @param $appAuthToken String 代调用token
|
||||
* @return $this 本客户端,便于链式调用
|
||||
*/
|
||||
public function agent($appAuthToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("app_auth_token", $appAuthToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权调用,指定authToken
|
||||
*
|
||||
* @param $authToken String 用户授权token
|
||||
* @return $this
|
||||
*/
|
||||
public function auth($authToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("auth_token", $authToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
*
|
||||
* @param $url String 异步通知回调地址,例如:https://www.test.com/callback
|
||||
* @return $this
|
||||
*/
|
||||
public function asyncNotify($url)
|
||||
{
|
||||
$this->_kernel->injectTextParam("notify_url", $url);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
*
|
||||
* @param $testUrl String 后端系统测试地址
|
||||
* @return $this
|
||||
*/
|
||||
public function route($testUrl)
|
||||
{
|
||||
$this->_kernel->injectTextParam("ws_service_url", $testUrl);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
*
|
||||
* @param $key String 业务请求参数名称(biz_content下的字段名,比如timeout_express)
|
||||
* @param $value object 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
* 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用String储存
|
||||
* 如果该字段是一个数值型类型(比如:Number),请使用Long储存
|
||||
* 如果该字段是一个复杂类型,请使用嵌套的array指定各下级字段的值
|
||||
* 如果该字段是一个数组,请使用array储存各个值
|
||||
* @return $this
|
||||
*/
|
||||
public function optional($key, $value)
|
||||
{
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
* optional方法的批量版本
|
||||
*
|
||||
* @param $optionalArgs array 可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释
|
||||
* @return $this
|
||||
*/
|
||||
public function batchOptional($optionalArgs)
|
||||
{
|
||||
foreach ($optionalArgs as $key => $value) {
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
104
vendor/alipaysdk/easysdk/php/src/Base/Qrcode/Models/AlipayOpenAppQrcodeCreateResponse.php
vendored
Normal file
104
vendor/alipaysdk/easysdk/php/src/Base/Qrcode/Models/AlipayOpenAppQrcodeCreateResponse.php
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\Qrcode\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class AlipayOpenAppQrcodeCreateResponse extends Model {
|
||||
protected $_name = [
|
||||
'httpBody' => 'http_body',
|
||||
'code' => 'code',
|
||||
'msg' => 'msg',
|
||||
'subCode' => 'sub_code',
|
||||
'subMsg' => 'sub_msg',
|
||||
'qrCodeUrl' => 'qr_code_url',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('httpBody', $this->httpBody, true);
|
||||
Model::validateRequired('code', $this->code, true);
|
||||
Model::validateRequired('msg', $this->msg, true);
|
||||
Model::validateRequired('subCode', $this->subCode, true);
|
||||
Model::validateRequired('subMsg', $this->subMsg, true);
|
||||
Model::validateRequired('qrCodeUrl', $this->qrCodeUrl, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->httpBody) {
|
||||
$res['http_body'] = $this->httpBody;
|
||||
}
|
||||
if (null !== $this->code) {
|
||||
$res['code'] = $this->code;
|
||||
}
|
||||
if (null !== $this->msg) {
|
||||
$res['msg'] = $this->msg;
|
||||
}
|
||||
if (null !== $this->subCode) {
|
||||
$res['sub_code'] = $this->subCode;
|
||||
}
|
||||
if (null !== $this->subMsg) {
|
||||
$res['sub_msg'] = $this->subMsg;
|
||||
}
|
||||
if (null !== $this->qrCodeUrl) {
|
||||
$res['qr_code_url'] = $this->qrCodeUrl;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return AlipayOpenAppQrcodeCreateResponse
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['http_body'])){
|
||||
$model->httpBody = $map['http_body'];
|
||||
}
|
||||
if(isset($map['code'])){
|
||||
$model->code = $map['code'];
|
||||
}
|
||||
if(isset($map['msg'])){
|
||||
$model->msg = $map['msg'];
|
||||
}
|
||||
if(isset($map['sub_code'])){
|
||||
$model->subCode = $map['sub_code'];
|
||||
}
|
||||
if(isset($map['sub_msg'])){
|
||||
$model->subMsg = $map['sub_msg'];
|
||||
}
|
||||
if(isset($map['qr_code_url'])){
|
||||
$model->qrCodeUrl = $map['qr_code_url'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description 响应原始字符串
|
||||
* @var string
|
||||
*/
|
||||
public $httpBody;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $msg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subMsg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $qrCodeUrl;
|
||||
|
||||
}
|
||||
198
vendor/alipaysdk/easysdk/php/src/Base/Video/Client.php
vendored
Normal file
198
vendor/alipaysdk/easysdk/php/src/Base/Video/Client.php
vendored
Normal file
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\Video;
|
||||
|
||||
use Alipay\EasySDK\Kernel\EasySDKKernel;
|
||||
use AlibabaCloud\Tea\Tea;
|
||||
use AlibabaCloud\Tea\Request;
|
||||
use AlibabaCloud\Tea\Exception\TeaError;
|
||||
use \Exception;
|
||||
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;
|
||||
|
||||
use Alipay\EasySDK\Base\Video\Models\AlipayOfflineMaterialImageUploadResponse;
|
||||
use AlibabaCloud\Tea\Response;
|
||||
|
||||
class Client {
|
||||
protected $_kernel;
|
||||
|
||||
public function __construct($kernel){
|
||||
$this->_kernel = $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $videoName
|
||||
* @param string $videoFilePath
|
||||
* @return AlipayOfflineMaterialImageUploadResponse
|
||||
* @throws TeaError
|
||||
* @throws Exception
|
||||
* @throws TeaUnableRetryError
|
||||
*/
|
||||
public function upload($videoName, $videoFilePath){
|
||||
$_runtime = [
|
||||
"ignoreSSL" => $this->_kernel->getConfig("ignoreSSL"),
|
||||
"httpProxy" => $this->_kernel->getConfig("httpProxy"),
|
||||
"connectTimeout" => 100000,
|
||||
"readTimeout" => 100000,
|
||||
"retry" => [
|
||||
"maxAttempts" => 0
|
||||
]
|
||||
];
|
||||
$_lastRequest = null;
|
||||
$_lastException = null;
|
||||
$_now = time();
|
||||
$_retryTimes = 0;
|
||||
while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
|
||||
if ($_retryTimes > 0) {
|
||||
$_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
|
||||
if ($_backoffTime > 0) {
|
||||
Tea::sleep($_backoffTime);
|
||||
}
|
||||
}
|
||||
$_retryTimes = $_retryTimes + 1;
|
||||
try {
|
||||
$_request = new Request();
|
||||
$systemParams = [
|
||||
"method" => "alipay.offline.material.image.upload",
|
||||
"app_id" => $this->_kernel->getConfig("appId"),
|
||||
"timestamp" => $this->_kernel->getTimestamp(),
|
||||
"format" => "json",
|
||||
"version" => "1.0",
|
||||
"alipay_sdk" => $this->_kernel->getSdkVersion(),
|
||||
"charset" => "UTF-8",
|
||||
"sign_type" => $this->_kernel->getConfig("signType"),
|
||||
"app_cert_sn" => $this->_kernel->getMerchantCertSN(),
|
||||
"alipay_root_cert_sn" => $this->_kernel->getAlipayRootCertSN()
|
||||
];
|
||||
$bizParams = [];
|
||||
$textParams = [
|
||||
"image_type" => "mp4",
|
||||
"image_name" => $videoName
|
||||
];
|
||||
$fileParams = [
|
||||
"image_content" => $videoFilePath
|
||||
];
|
||||
$boundary = $this->_kernel->getRandomBoundary();
|
||||
$_request->protocol = $this->_kernel->getConfig("protocol");
|
||||
$_request->method = "POST";
|
||||
$_request->pathname = "/gateway.do";
|
||||
$_request->headers = [
|
||||
"host" => $this->_kernel->getConfig("gatewayHost"),
|
||||
"content-type" => $this->_kernel->concatStr("multipart/form-data;charset=utf-8;boundary=", $boundary)
|
||||
];
|
||||
$_request->query = $this->_kernel->sortMap(Tea::merge([
|
||||
"sign" => $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"))
|
||||
], $systemParams));
|
||||
$_request->body = $this->_kernel->toMultipartRequestBody($textParams, $fileParams, $boundary);
|
||||
$_lastRequest = $_request;
|
||||
$_response= Tea::send($_request, $_runtime);
|
||||
$respMap = $this->_kernel->readAsJson($_response, "alipay.offline.material.image.upload");
|
||||
if ($this->_kernel->isCertMode()) {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->extractAlipayPublicKey($this->_kernel->getAlipayCertSN($respMap)))) {
|
||||
return AlipayOfflineMaterialImageUploadResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($this->_kernel->verify($respMap, $this->_kernel->getConfig("alipayPublicKey"))) {
|
||||
return AlipayOfflineMaterialImageUploadResponse::fromMap($this->_kernel->toRespModel($respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaError([
|
||||
"message" => "验签失败,请检查支付宝公钥设置是否正确。"
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if (!($e instanceof TeaError)) {
|
||||
$e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
if (Tea::isRetryable($e)) {
|
||||
$_lastException = $e;
|
||||
continue;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
throw new TeaUnableRetryError($_lastRequest, $_lastException);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISV代商户代用,指定appAuthToken
|
||||
*
|
||||
* @param $appAuthToken String 代调用token
|
||||
* @return $this 本客户端,便于链式调用
|
||||
*/
|
||||
public function agent($appAuthToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("app_auth_token", $appAuthToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户授权调用,指定authToken
|
||||
*
|
||||
* @param $authToken String 用户授权token
|
||||
* @return $this
|
||||
*/
|
||||
public function auth($authToken)
|
||||
{
|
||||
$this->_kernel->injectTextParam("auth_token", $authToken);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
*
|
||||
* @param $url String 异步通知回调地址,例如:https://www.test.com/callback
|
||||
* @return $this
|
||||
*/
|
||||
public function asyncNotify($url)
|
||||
{
|
||||
$this->_kernel->injectTextParam("notify_url", $url);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
*
|
||||
* @param $testUrl String 后端系统测试地址
|
||||
* @return $this
|
||||
*/
|
||||
public function route($testUrl)
|
||||
{
|
||||
$this->_kernel->injectTextParam("ws_service_url", $testUrl);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
*
|
||||
* @param $key String 业务请求参数名称(biz_content下的字段名,比如timeout_express)
|
||||
* @param $value object 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
* 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用String储存
|
||||
* 如果该字段是一个数值型类型(比如:Number),请使用Long储存
|
||||
* 如果该字段是一个复杂类型,请使用嵌套的array指定各下级字段的值
|
||||
* 如果该字段是一个数组,请使用array储存各个值
|
||||
* @return $this
|
||||
*/
|
||||
public function optional($key, $value)
|
||||
{
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
* optional方法的批量版本
|
||||
*
|
||||
* @param $optionalArgs array 可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释
|
||||
* @return $this
|
||||
*/
|
||||
public function batchOptional($optionalArgs)
|
||||
{
|
||||
foreach ($optionalArgs as $key => $value) {
|
||||
$this->_kernel->injectBizParam($key, $value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
117
vendor/alipaysdk/easysdk/php/src/Base/Video/Models/AlipayOfflineMaterialImageUploadResponse.php
vendored
Normal file
117
vendor/alipaysdk/easysdk/php/src/Base/Video/Models/AlipayOfflineMaterialImageUploadResponse.php
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace Alipay\EasySDK\Base\Video\Models;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class AlipayOfflineMaterialImageUploadResponse extends Model {
|
||||
protected $_name = [
|
||||
'httpBody' => 'http_body',
|
||||
'code' => 'code',
|
||||
'msg' => 'msg',
|
||||
'subCode' => 'sub_code',
|
||||
'subMsg' => 'sub_msg',
|
||||
'imageId' => 'image_id',
|
||||
'imageUrl' => 'image_url',
|
||||
];
|
||||
public function validate() {
|
||||
Model::validateRequired('httpBody', $this->httpBody, true);
|
||||
Model::validateRequired('code', $this->code, true);
|
||||
Model::validateRequired('msg', $this->msg, true);
|
||||
Model::validateRequired('subCode', $this->subCode, true);
|
||||
Model::validateRequired('subMsg', $this->subMsg, true);
|
||||
Model::validateRequired('imageId', $this->imageId, true);
|
||||
Model::validateRequired('imageUrl', $this->imageUrl, true);
|
||||
}
|
||||
public function toMap() {
|
||||
$res = [];
|
||||
if (null !== $this->httpBody) {
|
||||
$res['http_body'] = $this->httpBody;
|
||||
}
|
||||
if (null !== $this->code) {
|
||||
$res['code'] = $this->code;
|
||||
}
|
||||
if (null !== $this->msg) {
|
||||
$res['msg'] = $this->msg;
|
||||
}
|
||||
if (null !== $this->subCode) {
|
||||
$res['sub_code'] = $this->subCode;
|
||||
}
|
||||
if (null !== $this->subMsg) {
|
||||
$res['sub_msg'] = $this->subMsg;
|
||||
}
|
||||
if (null !== $this->imageId) {
|
||||
$res['image_id'] = $this->imageId;
|
||||
}
|
||||
if (null !== $this->imageUrl) {
|
||||
$res['image_url'] = $this->imageUrl;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return AlipayOfflineMaterialImageUploadResponse
|
||||
*/
|
||||
public static function fromMap($map = []) {
|
||||
$model = new self();
|
||||
if(isset($map['http_body'])){
|
||||
$model->httpBody = $map['http_body'];
|
||||
}
|
||||
if(isset($map['code'])){
|
||||
$model->code = $map['code'];
|
||||
}
|
||||
if(isset($map['msg'])){
|
||||
$model->msg = $map['msg'];
|
||||
}
|
||||
if(isset($map['sub_code'])){
|
||||
$model->subCode = $map['sub_code'];
|
||||
}
|
||||
if(isset($map['sub_msg'])){
|
||||
$model->subMsg = $map['sub_msg'];
|
||||
}
|
||||
if(isset($map['image_id'])){
|
||||
$model->imageId = $map['image_id'];
|
||||
}
|
||||
if(isset($map['image_url'])){
|
||||
$model->imageUrl = $map['image_url'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description 响应原始字符串
|
||||
* @var string
|
||||
*/
|
||||
public $httpBody;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $msg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subCode;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $subMsg;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $imageId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $imageUrl;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user