添加网站文件
This commit is contained in:
32
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/AlipayEasySDK.csproj
vendored
Normal file
32
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/AlipayEasySDK.csproj
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
|
||||
<PackOnBuild>true</PackOnBuild>
|
||||
<PackageVersion>2.1.2</PackageVersion>
|
||||
<Authors>antopen</Authors>
|
||||
<NeutralLanguage>zh</NeutralLanguage>
|
||||
<PackageLicenseUrl>https://github.com/alipay/alipay-easysdk/blob/master/LICENSE</PackageLicenseUrl>
|
||||
<Description>Alipay Easy SDK for .NET allows you to enjoy a minimalist programming experience and quickly access the various high-frequency capabilities of the Alipay Open Platform.</Description>
|
||||
<PackageId>AlipayEasySDK</PackageId>
|
||||
<Owners>antopen</Owners>
|
||||
<PackageProjectUrl>https://github.com/alipay/alipay-easysdk/tree/master/csharp</PackageProjectUrl>
|
||||
<Summary>Alipay Easy SDK for .NET allows you to enjoy a minimalist programming experience and quickly access the various high-frequency capabilities of the Alipay Open Platform.</Summary>
|
||||
<Title>Alipay Easy SDK</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType></DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Class1.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Factory\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AlipayEasySDK.Kernel" Version="1.0.5" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
324
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/Image/Client.cs
vendored
Normal file
324
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/Image/Client.cs
vendored
Normal file
@@ -0,0 +1,324 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Base.Image.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Base.Image
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayOfflineMaterialImageUploadResponse Upload(string imageName, string imageFilePath)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 100000},
|
||||
{"readTimeout", 100000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_type", "jpg"},
|
||||
{"image_name", imageName},
|
||||
};
|
||||
Dictionary<string, string> fileParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_content", imageFilePath},
|
||||
};
|
||||
string boundary = this._kernel.GetRandomBoundary();
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", this._kernel.ConcatStr("multipart/form-data;charset=utf-8;boundary=", boundary)},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams
|
||||
));
|
||||
request_.Body = this._kernel.ToMultipartRequestBody(textParams, fileParams, boundary);
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> 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 TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayOfflineMaterialImageUploadResponse> UploadAsync(string imageName, string imageFilePath)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 100000},
|
||||
{"readTimeout", 100000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_type", "jpg"},
|
||||
{"image_name", imageName},
|
||||
};
|
||||
Dictionary<string, string> fileParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_content", imageFilePath},
|
||||
};
|
||||
string boundary = this._kernel.GetRandomBoundary();
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", this._kernel.ConcatStr("multipart/form-data;charset=utf-8;boundary=", boundary)},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams
|
||||
));
|
||||
request_.Body = this._kernel.ToMultipartRequestBody(textParams, fileParams, boundary);
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.offline.material.image.upload");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Base.Image.Models
|
||||
{
|
||||
public class AlipayOfflineMaterialImageUploadResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("image_id")]
|
||||
[Validation(Required=true)]
|
||||
public string ImageId { get; set; }
|
||||
|
||||
[NameInMap("image_url")]
|
||||
[Validation(Required=true)]
|
||||
public string ImageUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
528
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/OAuth/Client.cs
vendored
Normal file
528
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/OAuth/Client.cs
vendored
Normal file
@@ -0,0 +1,528 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Base.OAuth.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Base.OAuth
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipaySystemOauthTokenResponse GetToken(string code)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"grant_type", "authorization_code"},
|
||||
{"code", code},
|
||||
};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> 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 TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipaySystemOauthTokenResponse> GetTokenAsync(string code)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"grant_type", "authorization_code"},
|
||||
{"code", code},
|
||||
};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.system.oauth.token");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipaySystemOauthTokenResponse RefreshToken(string refreshToken)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"grant_type", "refresh_token"},
|
||||
{"refresh_token", refreshToken},
|
||||
};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> 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 TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipaySystemOauthTokenResponse> RefreshTokenAsync(string refreshToken)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"grant_type", "refresh_token"},
|
||||
{"refresh_token", refreshToken},
|
||||
};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.system.oauth.token");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySystemOauthTokenResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Base.OAuth.Models
|
||||
{
|
||||
public class AlipaySystemOauthTokenResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("user_id")]
|
||||
[Validation(Required=true)]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[NameInMap("access_token")]
|
||||
[Validation(Required=true)]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
[NameInMap("expires_in")]
|
||||
[Validation(Required=true)]
|
||||
public long ExpiresIn { get; set; }
|
||||
|
||||
[NameInMap("refresh_token")]
|
||||
[Validation(Required=true)]
|
||||
public string RefreshToken { get; set; }
|
||||
|
||||
[NameInMap("re_expires_in")]
|
||||
[Validation(Required=true)]
|
||||
public long ReExpiresIn { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
318
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/Qrcode/Client.cs
vendored
Normal file
318
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/Qrcode/Client.cs
vendored
Normal file
@@ -0,0 +1,318 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Base.Qrcode.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Base.Qrcode
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayOpenAppQrcodeCreateResponse Create(string urlParam, string queryParam, string describe)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"url_param", urlParam},
|
||||
{"query_param", queryParam},
|
||||
{"describe", describe},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> 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 TeaModel.ToObject<AlipayOpenAppQrcodeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppQrcodeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayOpenAppQrcodeCreateResponse> CreateAsync(string urlParam, string queryParam, string describe)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"url_param", urlParam},
|
||||
{"query_param", queryParam},
|
||||
{"describe", describe},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.open.app.qrcode.create");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppQrcodeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppQrcodeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Base.Qrcode.Models
|
||||
{
|
||||
public class AlipayOpenAppQrcodeCreateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("qr_code_url")]
|
||||
[Validation(Required=true)]
|
||||
public string QrCodeUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
324
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/Video/Client.cs
vendored
Normal file
324
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Base/Video/Client.cs
vendored
Normal file
@@ -0,0 +1,324 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Base.Video.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Base.Video
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayOfflineMaterialImageUploadResponse Upload(string videoName, string videoFilePath)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 100000},
|
||||
{"readTimeout", 100000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_type", "mp4"},
|
||||
{"image_name", videoName},
|
||||
};
|
||||
Dictionary<string, string> fileParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_content", videoFilePath},
|
||||
};
|
||||
string boundary = this._kernel.GetRandomBoundary();
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", this._kernel.ConcatStr("multipart/form-data;charset=utf-8;boundary=", boundary)},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams
|
||||
));
|
||||
request_.Body = this._kernel.ToMultipartRequestBody(textParams, fileParams, boundary);
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> 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 TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayOfflineMaterialImageUploadResponse> UploadAsync(string videoName, string videoFilePath)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 100000},
|
||||
{"readTimeout", 100000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>(){};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_type", "mp4"},
|
||||
{"image_name", videoName},
|
||||
};
|
||||
Dictionary<string, string> fileParams = new Dictionary<string, string>
|
||||
{
|
||||
{"image_content", videoFilePath},
|
||||
};
|
||||
string boundary = this._kernel.GetRandomBoundary();
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", this._kernel.ConcatStr("multipart/form-data;charset=utf-8;boundary=", boundary)},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams
|
||||
));
|
||||
request_.Body = this._kernel.ToMultipartRequestBody(textParams, fileParams, boundary);
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.offline.material.image.upload");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOfflineMaterialImageUploadResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Base.Video.Models
|
||||
{
|
||||
public class AlipayOfflineMaterialImageUploadResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("image_id")]
|
||||
[Validation(Required=true)]
|
||||
public string ImageId { get; set; }
|
||||
|
||||
[NameInMap("image_url")]
|
||||
[Validation(Required=true)]
|
||||
public string ImageUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
244
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Factory/Factory.cs
vendored
Normal file
244
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Factory/Factory.cs
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using Alipay.EasySDK.Kernel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Alipay.EasySDK.Factory
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户端工厂,用于快速配置和访问各种场景下的API Client
|
||||
///
|
||||
/// 注:该Factory获取的Client不可储存重复使用,请每次均通过Factory完成调用
|
||||
/// </summary>
|
||||
public static class Factory
|
||||
{
|
||||
public const string SDK_VERSION = "alipay-easysdk-net-2.1.0";
|
||||
|
||||
/// <summary>
|
||||
/// 将一些初始化耗时较多的信息缓存在上下文中
|
||||
/// </summary>
|
||||
private static Context context;
|
||||
|
||||
/// <summary>
|
||||
/// 设置客户端参数,只需设置一次,即可反复使用各种场景下的API Client
|
||||
/// </summary>
|
||||
/// <param name="options">客户端参数对象</param>
|
||||
public static void SetOptions(Config options)
|
||||
{
|
||||
context = new Context(options, SDK_VERSION);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取调用OpenAPI所需的客户端实例
|
||||
/// 本方法用于调用SDK扩展包中的API Client下的方法
|
||||
///
|
||||
/// 注:返回的实例不可重复使用,只可用于单次调用
|
||||
/// </summary>
|
||||
/// <typeparam name="T">泛型参数</typeparam>
|
||||
/// <param name="client">API Client的类型对象</param>
|
||||
/// <returns>client实例,用于发起单次调用</returns>
|
||||
public static T GetClient<T>()
|
||||
{
|
||||
Type type = typeof(T);
|
||||
ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(Client) });
|
||||
context.SdkVersion = GetSdkVersion(type);
|
||||
return (T)constructor.Invoke(new object[] { new Client(context) });
|
||||
}
|
||||
|
||||
private static string GetSdkVersion(Type client)
|
||||
{
|
||||
return context.SdkVersion + "-" + client.FullName
|
||||
.Replace("EasySDK.", "")
|
||||
.Replace(".Client", "")
|
||||
.Replace(".", "-");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基础能力相关
|
||||
/// </summary>
|
||||
public static class Base
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取图片相关API Client
|
||||
/// </summary>
|
||||
/// <returns>图片相关API Client</returns>
|
||||
public static EasySDK.Base.Image.Client Image()
|
||||
{
|
||||
return new EasySDK.Base.Image.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取视频相关API Client
|
||||
/// </summary>
|
||||
/// <returns>视频相关API Client</returns>
|
||||
public static EasySDK.Base.Video.Client Video()
|
||||
{
|
||||
return new EasySDK.Base.Video.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取OAuth认证相关API Client
|
||||
/// </summary>
|
||||
/// <returns>OAuth认证相关API Client</returns>
|
||||
public static EasySDK.Base.OAuth.Client OAuth()
|
||||
{
|
||||
return new EasySDK.Base.OAuth.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取小程序二维码相关API Client
|
||||
/// </summary>
|
||||
/// <returns>小程序二维码相关API Client</returns>
|
||||
public static EasySDK.Base.Qrcode.Client Qrcode()
|
||||
{
|
||||
return new EasySDK.Base.Qrcode.Client(new Client(context));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 营销能力相关
|
||||
/// </summary>
|
||||
public static class Marketing
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取生活号相关API Client
|
||||
/// </summary>
|
||||
/// <returns>生活号相关API Client</returns>
|
||||
public static EasySDK.Marketing.OpenLife.Client OpenLife()
|
||||
{
|
||||
return new EasySDK.Marketing.OpenLife.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取支付宝卡包相关API Client
|
||||
/// </summary>
|
||||
/// <returns>支付宝卡包相关API Client</returns>
|
||||
public static EasySDK.Marketing.Pass.Client Pass()
|
||||
{
|
||||
return new EasySDK.Marketing.Pass.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取小程序模板消息相关API Client
|
||||
/// </summary>
|
||||
/// <returns>小程序模板消息相关API Client</returns>
|
||||
public static EasySDK.Marketing.TemplateMessage.Client TemplateMessage()
|
||||
{
|
||||
return new EasySDK.Marketing.TemplateMessage.Client(new Client(context));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 会员能力相关
|
||||
/// </summary>
|
||||
public static class Member
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取支付宝身份认证相关API Client
|
||||
/// </summary>
|
||||
/// <returns>支付宝身份认证相关API Client</returns>
|
||||
public static EasySDK.Member.Identification.Client Identification()
|
||||
{
|
||||
return new EasySDK.Member.Identification.Client(new Client(context));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 支付能力相关
|
||||
/// </summary>
|
||||
public static class Payment
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取支付通用API Client
|
||||
/// </summary>
|
||||
/// <returns>支付通用API Client</returns>
|
||||
public static EasySDK.Payment.Common.Client Common()
|
||||
{
|
||||
return new EasySDK.Payment.Common.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当面付API Client
|
||||
/// </summary>
|
||||
/// <returns>当面付API Client</returns>
|
||||
public static EasySDK.Payment.FaceToFace.Client FaceToFace()
|
||||
{
|
||||
return new EasySDK.Payment.FaceToFace.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取花呗API Client
|
||||
/// </summary>
|
||||
/// <returns>花呗API Client</returns>
|
||||
public static EasySDK.Payment.Huabei.Client Huabei()
|
||||
{
|
||||
return new EasySDK.Payment.Huabei.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取手机APP支付API Client
|
||||
/// </summary>
|
||||
/// <returns>手机APP支付API Client</returns>
|
||||
public static EasySDK.Payment.App.Client App()
|
||||
{
|
||||
return new EasySDK.Payment.App.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取电脑网站支付API Client
|
||||
/// </summary>
|
||||
/// <returns>电脑网站支付API</returns>
|
||||
public static EasySDK.Payment.Page.Client Page()
|
||||
{
|
||||
return new EasySDK.Payment.Page.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取手机网站支付API Client
|
||||
/// </summary>
|
||||
/// <returns>手机网站支付API</returns>
|
||||
public static EasySDK.Payment.Wap.Client Wap()
|
||||
{
|
||||
return new EasySDK.Payment.Wap.Client(new Client(context));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安全能力相关
|
||||
/// </summary>
|
||||
public static class Security
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取文本风险识别相关API Client
|
||||
/// </summary>
|
||||
/// <returns>文本风险识别相关API Client</returns>
|
||||
public static EasySDK.Security.TextRisk.Client TextRisk()
|
||||
{
|
||||
return new EasySDK.Security.TextRisk.Client(new Client(context));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 辅助工具
|
||||
/// </summary>
|
||||
public static class Util
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取OpenAPI通用接口,可通过自行拼装参数,调用几乎所有OpenAPI
|
||||
/// </summary>
|
||||
/// <returns>OpenAPI通用接口</returns>
|
||||
public static EasySDK.Util.Generic.Client Generic()
|
||||
{
|
||||
return new EasySDK.Util.Generic.Client(new Client(context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取AES128加解密相关API Client,常用于会员手机号的解密
|
||||
/// </summary>
|
||||
/// <returns>AES128加解密相关API Client</returns>
|
||||
public static EasySDK.Util.AES.Client AES()
|
||||
{
|
||||
return new EasySDK.Util.AES.Client(new Client(context));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1832
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Client.cs
vendored
Normal file
1832
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Client.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicLifeMsgRecallResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicMessageContentCreateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("content_id")]
|
||||
[Validation(Required=true)]
|
||||
public string ContentId { get; set; }
|
||||
|
||||
[NameInMap("content_url")]
|
||||
[Validation(Required=true)]
|
||||
public string ContentUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicMessageContentModifyResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("content_id")]
|
||||
[Validation(Required=true)]
|
||||
public string ContentId { get; set; }
|
||||
|
||||
[NameInMap("content_url")]
|
||||
[Validation(Required=true)]
|
||||
public string ContentUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicMessageSingleSendResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicMessageTotalSendResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("message_id")]
|
||||
[Validation(Required=true)]
|
||||
public string MessageId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicSettingCategoryQueryResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("primary_category")]
|
||||
[Validation(Required=true)]
|
||||
public string PrimaryCategory { get; set; }
|
||||
|
||||
[NameInMap("secondary_category")]
|
||||
[Validation(Required=true)]
|
||||
public string SecondaryCategory { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class AlipayOpenPublicTemplateMessageIndustryModifyResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
34
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Article.cs
vendored
Normal file
34
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Article.cs
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class Article : TeaModel {
|
||||
[NameInMap("title")]
|
||||
[Validation(Required=false)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[NameInMap("desc")]
|
||||
[Validation(Required=true)]
|
||||
public string Desc { get; set; }
|
||||
|
||||
[NameInMap("image_url")]
|
||||
[Validation(Required=false)]
|
||||
public string ImageUrl { get; set; }
|
||||
|
||||
[NameInMap("url")]
|
||||
[Validation(Required=true)]
|
||||
public string Url { get; set; }
|
||||
|
||||
[NameInMap("action_name")]
|
||||
[Validation(Required=false)]
|
||||
public string ActionName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Context.cs
vendored
Normal file
42
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Context.cs
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class Context : TeaModel {
|
||||
[NameInMap("head_color")]
|
||||
[Validation(Required=true)]
|
||||
public string HeadColor { get; set; }
|
||||
|
||||
[NameInMap("url")]
|
||||
[Validation(Required=true)]
|
||||
public string Url { get; set; }
|
||||
|
||||
[NameInMap("action_name")]
|
||||
[Validation(Required=true)]
|
||||
public string ActionName { get; set; }
|
||||
|
||||
[NameInMap("keyword1")]
|
||||
[Validation(Required=false)]
|
||||
public Keyword Keyword1 { get; set; }
|
||||
|
||||
[NameInMap("keyword2")]
|
||||
[Validation(Required=false)]
|
||||
public Keyword Keyword2 { get; set; }
|
||||
|
||||
[NameInMap("first")]
|
||||
[Validation(Required=false)]
|
||||
public Keyword First { get; set; }
|
||||
|
||||
[NameInMap("remark")]
|
||||
[Validation(Required=false)]
|
||||
public Keyword Remark { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Keyword.cs
vendored
Normal file
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Keyword.cs
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class Keyword : TeaModel {
|
||||
[NameInMap("color")]
|
||||
[Validation(Required=true)]
|
||||
public string Color { get; set; }
|
||||
|
||||
[NameInMap("value")]
|
||||
[Validation(Required=true)]
|
||||
public string Value { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Template.cs
vendored
Normal file
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Template.cs
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class Template : TeaModel {
|
||||
[NameInMap("template_id")]
|
||||
[Validation(Required=true)]
|
||||
public string TemplateId { get; set; }
|
||||
|
||||
[NameInMap("context")]
|
||||
[Validation(Required=true)]
|
||||
public Context Context { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Text.cs
vendored
Normal file
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/OpenLife/Models/Text.cs
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.OpenLife.Models
|
||||
{
|
||||
public class Text : TeaModel {
|
||||
[NameInMap("title")]
|
||||
[Validation(Required=true)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[NameInMap("content")]
|
||||
[Validation(Required=true)]
|
||||
public string Content { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
964
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/Pass/Client.cs
vendored
Normal file
964
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/Pass/Client.cs
vendored
Normal file
@@ -0,0 +1,964 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Marketing.Pass.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.Pass
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayPassTemplateAddResponse CreateTemplate(string uniqueId, string tplContent)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.template.add"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"unique_id", uniqueId},
|
||||
{"tpl_content", tplContent},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.pass.template.add");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayPassTemplateAddResponse> CreateTemplateAsync(string uniqueId, string tplContent)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.template.add"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"unique_id", uniqueId},
|
||||
{"tpl_content", tplContent},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.pass.template.add");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipayPassTemplateUpdateResponse UpdateTemplate(string tplId, string tplContent)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.template.update"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"tpl_id", tplId},
|
||||
{"tpl_content", tplContent},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.pass.template.update");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayPassTemplateUpdateResponse> UpdateTemplateAsync(string tplId, string tplContent)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.template.update"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"tpl_id", tplId},
|
||||
{"tpl_content", tplContent},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.pass.template.update");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassTemplateUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipayPassInstanceAddResponse AddInstance(string tplId, string tplParams, string recognitionType, string recognitionInfo)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.instance.add"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"tpl_id", tplId},
|
||||
{"tpl_params", tplParams},
|
||||
{"recognition_type", recognitionType},
|
||||
{"recognition_info", recognitionInfo},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.pass.instance.add");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayPassInstanceAddResponse> AddInstanceAsync(string tplId, string tplParams, string recognitionType, string recognitionInfo)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.instance.add"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"tpl_id", tplId},
|
||||
{"tpl_params", tplParams},
|
||||
{"recognition_type", recognitionType},
|
||||
{"recognition_info", recognitionInfo},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.pass.instance.add");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceAddResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipayPassInstanceUpdateResponse UpdateInstance(string serialNumber, string channelId, string tplParams, string status, string verifyCode, string verifyType)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.instance.update"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"serial_number", serialNumber},
|
||||
{"channel_id", channelId},
|
||||
{"tpl_params", tplParams},
|
||||
{"status", status},
|
||||
{"verify_code", verifyCode},
|
||||
{"verify_type", verifyType},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.pass.instance.update");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayPassInstanceUpdateResponse> UpdateInstanceAsync(string serialNumber, string channelId, string tplParams, string status, string verifyCode, string verifyType)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.pass.instance.update"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"serial_number", serialNumber},
|
||||
{"channel_id", channelId},
|
||||
{"tpl_params", tplParams},
|
||||
{"status", status},
|
||||
{"verify_code", verifyCode},
|
||||
{"verify_type", verifyType},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.pass.instance.update");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayPassInstanceUpdateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.Pass.Models
|
||||
{
|
||||
public class AlipayPassInstanceAddResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("success")]
|
||||
[Validation(Required=true)]
|
||||
public bool? Success { get; set; }
|
||||
|
||||
[NameInMap("result")]
|
||||
[Validation(Required=true)]
|
||||
public string Result { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.Pass.Models
|
||||
{
|
||||
public class AlipayPassInstanceUpdateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("success")]
|
||||
[Validation(Required=true)]
|
||||
public bool? Success { get; set; }
|
||||
|
||||
[NameInMap("result")]
|
||||
[Validation(Required=true)]
|
||||
public string Result { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.Pass.Models
|
||||
{
|
||||
public class AlipayPassTemplateAddResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("success")]
|
||||
[Validation(Required=true)]
|
||||
public bool? Success { get; set; }
|
||||
|
||||
[NameInMap("result")]
|
||||
[Validation(Required=true)]
|
||||
public string Result { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.Pass.Models
|
||||
{
|
||||
public class AlipayPassTemplateUpdateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("success")]
|
||||
[Validation(Required=true)]
|
||||
public bool? Success { get; set; }
|
||||
|
||||
[NameInMap("result")]
|
||||
[Validation(Required=true)]
|
||||
public string Result { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
322
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/TemplateMessage/Client.cs
vendored
Normal file
322
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Marketing/TemplateMessage/Client.cs
vendored
Normal file
@@ -0,0 +1,322 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Marketing.TemplateMessage.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.TemplateMessage
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayOpenAppMiniTemplatemessageSendResponse Send(string toUserId, string formId, string userTemplateId, string page, string data)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.open.app.mini.templatemessage.send"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"to_user_id", toUserId},
|
||||
{"form_id", formId},
|
||||
{"user_template_id", userTemplateId},
|
||||
{"page", page},
|
||||
{"data", data},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.open.app.mini.templatemessage.send");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppMiniTemplatemessageSendResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppMiniTemplatemessageSendResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayOpenAppMiniTemplatemessageSendResponse> SendAsync(string toUserId, string formId, string userTemplateId, string page, string data)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.open.app.mini.templatemessage.send"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"to_user_id", toUserId},
|
||||
{"form_id", formId},
|
||||
{"user_template_id", userTemplateId},
|
||||
{"page", page},
|
||||
{"data", data},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.open.app.mini.templatemessage.send");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppMiniTemplatemessageSendResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenAppMiniTemplatemessageSendResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Marketing.TemplateMessage.Models
|
||||
{
|
||||
public class AlipayOpenAppMiniTemplatemessageSendResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
562
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Member/Identification/Client.cs
vendored
Normal file
562
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Member/Identification/Client.cs
vendored
Normal file
@@ -0,0 +1,562 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Member.Identification.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Member.Identification
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayUserCertifyOpenInitializeResponse Init(string outerOrderNo, string bizCode, IdentityParam identityParam, MerchantConfig merchantConfig)
|
||||
{
|
||||
identityParam.Validate();
|
||||
merchantConfig.Validate();
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.user.certify.open.initialize"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"outer_order_no", outerOrderNo},
|
||||
{"biz_code", bizCode},
|
||||
{"identity_param", identityParam},
|
||||
{"merchant_config", merchantConfig},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.user.certify.open.initialize");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenInitializeResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenInitializeResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayUserCertifyOpenInitializeResponse> InitAsync(string outerOrderNo, string bizCode, IdentityParam identityParam, MerchantConfig merchantConfig)
|
||||
{
|
||||
identityParam.Validate();
|
||||
merchantConfig.Validate();
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.user.certify.open.initialize"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"outer_order_no", outerOrderNo},
|
||||
{"biz_code", bizCode},
|
||||
{"identity_param", identityParam},
|
||||
{"merchant_config", merchantConfig},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.user.certify.open.initialize");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenInitializeResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenInitializeResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipayUserCertifyOpenQueryResponse Query(string certifyId)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.user.certify.open.query"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"certify_id", certifyId},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.user.certify.open.query");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenQueryResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenQueryResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayUserCertifyOpenQueryResponse> QueryAsync(string certifyId)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.user.certify.open.query"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"certify_id", certifyId},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.user.certify.open.query");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenQueryResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenQueryResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipayUserCertifyOpenCertifyResponse Certify(string certifyId)
|
||||
{
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.user.certify.open.certify"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"certify_id", certifyId},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
string sign = this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"));
|
||||
Dictionary<string, string> response = new Dictionary<string, string>
|
||||
{
|
||||
{"body", this._kernel.GeneratePage("GET", systemParams, bizParams, textParams, sign)},
|
||||
};
|
||||
return TeaModel.ToObject<AlipayUserCertifyOpenCertifyResponse>(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Member.Identification.Models
|
||||
{
|
||||
public class AlipayUserCertifyOpenCertifyResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 认证服务请求地址
|
||||
/// </summary>
|
||||
[NameInMap("body")]
|
||||
[Validation(Required=true)]
|
||||
public string Body { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Member.Identification.Models
|
||||
{
|
||||
public class AlipayUserCertifyOpenInitializeResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("certify_id")]
|
||||
[Validation(Required=true)]
|
||||
public string CertifyId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Member.Identification.Models
|
||||
{
|
||||
public class AlipayUserCertifyOpenQueryResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("passed")]
|
||||
[Validation(Required=true)]
|
||||
public string Passed { get; set; }
|
||||
|
||||
[NameInMap("identity_info")]
|
||||
[Validation(Required=true)]
|
||||
public string IdentityInfo { get; set; }
|
||||
|
||||
[NameInMap("material_info")]
|
||||
[Validation(Required=true)]
|
||||
public string MaterialInfo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
30
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Member/Identification/Models/IdentityParam.cs
vendored
Normal file
30
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Member/Identification/Models/IdentityParam.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Member.Identification.Models
|
||||
{
|
||||
public class IdentityParam : TeaModel {
|
||||
[NameInMap("identity_type")]
|
||||
[Validation(Required=true)]
|
||||
public string IdentityType { get; set; }
|
||||
|
||||
[NameInMap("cert_type")]
|
||||
[Validation(Required=true)]
|
||||
public string CertType { get; set; }
|
||||
|
||||
[NameInMap("cert_name")]
|
||||
[Validation(Required=true)]
|
||||
public string CertName { get; set; }
|
||||
|
||||
[NameInMap("cert_no")]
|
||||
[Validation(Required=true)]
|
||||
public string CertNo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
18
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Member/Identification/Models/MerchantConfig.cs
vendored
Normal file
18
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Member/Identification/Models/MerchantConfig.cs
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Member.Identification.Models
|
||||
{
|
||||
public class MerchantConfig : TeaModel {
|
||||
[NameInMap("return_url")]
|
||||
[Validation(Required=true)]
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
135
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/App/Client.cs
vendored
Normal file
135
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/App/Client.cs
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Payment.App.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.App
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
|
||||
public AlipayTradeAppPayResponse Pay(string subject, string outTradeNo, string totalAmount)
|
||||
{
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.app.pay"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
string sign = this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"));
|
||||
Dictionary<string, string> response = new Dictionary<string, string>
|
||||
{
|
||||
{"body", this._kernel.GenerateOrderString(systemParams, bizParams, textParams, sign)},
|
||||
};
|
||||
return TeaModel.ToObject<AlipayTradeAppPayResponse>(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/App/Models/AlipayTradeAppPayResponse.cs
vendored
Normal file
21
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/App/Models/AlipayTradeAppPayResponse.cs
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.App.Models
|
||||
{
|
||||
public class AlipayTradeAppPayResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 订单信息,字符串形式
|
||||
/// </summary>
|
||||
[NameInMap("body")]
|
||||
[Validation(Required=true)]
|
||||
public string Body { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
1598
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Client.cs
vendored
Normal file
1598
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Client.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayDataDataserviceBillDownloadurlQueryResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("bill_download_url")]
|
||||
[Validation(Required=true)]
|
||||
public string BillDownloadUrl { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
61
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeCancelResponse.cs
vendored
Normal file
61
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeCancelResponse.cs
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayTradeCancelResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("retry_flag")]
|
||||
[Validation(Required=true)]
|
||||
public string RetryFlag { get; set; }
|
||||
|
||||
[NameInMap("action")]
|
||||
[Validation(Required=true)]
|
||||
public string Action { get; set; }
|
||||
|
||||
[NameInMap("gmt_refund_pay")]
|
||||
[Validation(Required=true)]
|
||||
public string GmtRefundPay { get; set; }
|
||||
|
||||
[NameInMap("refund_settlement_id")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundSettlementId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
45
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeCloseResponse.cs
vendored
Normal file
45
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeCloseResponse.cs
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayTradeCloseResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
45
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeCreateResponse.cs
vendored
Normal file
45
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeCreateResponse.cs
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayTradeCreateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayTradeFastpayRefundQueryResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("error_code")]
|
||||
[Validation(Required=true)]
|
||||
public string ErrorCode { get; set; }
|
||||
|
||||
[NameInMap("gmt_refund_pay")]
|
||||
[Validation(Required=true)]
|
||||
public string GmtRefundPay { get; set; }
|
||||
|
||||
[NameInMap("industry_sepc_detail")]
|
||||
[Validation(Required=true)]
|
||||
public string IndustrySepcDetail { get; set; }
|
||||
|
||||
[NameInMap("out_request_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutRequestNo { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("present_refund_buyer_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PresentRefundBuyerAmount { get; set; }
|
||||
|
||||
[NameInMap("present_refund_discount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PresentRefundDiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("present_refund_mdiscount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PresentRefundMdiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("refund_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundAmount { get; set; }
|
||||
|
||||
[NameInMap("refund_charge_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundChargeAmount { get; set; }
|
||||
|
||||
[NameInMap("refund_detail_item_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<TradeFundBill> RefundDetailItemList { get; set; }
|
||||
|
||||
[NameInMap("refund_reason")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundReason { get; set; }
|
||||
|
||||
[NameInMap("refund_royaltys")]
|
||||
[Validation(Required=true)]
|
||||
public List<RefundRoyaltyResult> RefundRoyaltys { get; set; }
|
||||
|
||||
[NameInMap("refund_settlement_id")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundSettlementId { get; set; }
|
||||
|
||||
[NameInMap("refund_status")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundStatus { get; set; }
|
||||
|
||||
[NameInMap("send_back_fee")]
|
||||
[Validation(Required=true)]
|
||||
public string SendBackFee { get; set; }
|
||||
|
||||
[NameInMap("total_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string TotalAmount { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
177
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeQueryResponse.cs
vendored
Normal file
177
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeQueryResponse.cs
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayTradeQueryResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("buyer_logon_id")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerLogonId { get; set; }
|
||||
|
||||
[NameInMap("trade_status")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeStatus { get; set; }
|
||||
|
||||
[NameInMap("total_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string TotalAmount { get; set; }
|
||||
|
||||
[NameInMap("trans_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string TransCurrency { get; set; }
|
||||
|
||||
[NameInMap("settle_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string SettleCurrency { get; set; }
|
||||
|
||||
[NameInMap("settle_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string SettleAmount { get; set; }
|
||||
|
||||
[NameInMap("pay_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string PayCurrency { get; set; }
|
||||
|
||||
[NameInMap("pay_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PayAmount { get; set; }
|
||||
|
||||
[NameInMap("settle_trans_rate")]
|
||||
[Validation(Required=true)]
|
||||
public string SettleTransRate { get; set; }
|
||||
|
||||
[NameInMap("trans_pay_rate")]
|
||||
[Validation(Required=true)]
|
||||
public string TransPayRate { get; set; }
|
||||
|
||||
[NameInMap("buyer_pay_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerPayAmount { get; set; }
|
||||
|
||||
[NameInMap("point_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PointAmount { get; set; }
|
||||
|
||||
[NameInMap("invoice_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string InvoiceAmount { get; set; }
|
||||
|
||||
[NameInMap("send_pay_date")]
|
||||
[Validation(Required=true)]
|
||||
public string SendPayDate { get; set; }
|
||||
|
||||
[NameInMap("receipt_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string ReceiptAmount { get; set; }
|
||||
|
||||
[NameInMap("store_id")]
|
||||
[Validation(Required=true)]
|
||||
public string StoreId { get; set; }
|
||||
|
||||
[NameInMap("terminal_id")]
|
||||
[Validation(Required=true)]
|
||||
public string TerminalId { get; set; }
|
||||
|
||||
[NameInMap("fund_bill_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<TradeFundBill> FundBillList { get; set; }
|
||||
|
||||
[NameInMap("store_name")]
|
||||
[Validation(Required=true)]
|
||||
public string StoreName { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_id")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserId { get; set; }
|
||||
|
||||
[NameInMap("charge_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string ChargeAmount { get; set; }
|
||||
|
||||
[NameInMap("charge_flags")]
|
||||
[Validation(Required=true)]
|
||||
public string ChargeFlags { get; set; }
|
||||
|
||||
[NameInMap("settlement_id")]
|
||||
[Validation(Required=true)]
|
||||
public string SettlementId { get; set; }
|
||||
|
||||
[NameInMap("trade_settle_info")]
|
||||
[Validation(Required=true)]
|
||||
public List<TradeSettleInfo> TradeSettleInfo { get; set; }
|
||||
|
||||
[NameInMap("auth_trade_pay_mode")]
|
||||
[Validation(Required=true)]
|
||||
public string AuthTradePayMode { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_type")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserType { get; set; }
|
||||
|
||||
[NameInMap("mdiscount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string MdiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("discount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string DiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_name")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserName { get; set; }
|
||||
|
||||
[NameInMap("subject")]
|
||||
[Validation(Required=true)]
|
||||
public string Subject { get; set; }
|
||||
|
||||
[NameInMap("body")]
|
||||
[Validation(Required=true)]
|
||||
public string Body { get; set; }
|
||||
|
||||
[NameInMap("alipay_sub_merchant_id")]
|
||||
[Validation(Required=true)]
|
||||
public string AlipaySubMerchantId { get; set; }
|
||||
|
||||
[NameInMap("ext_infos")]
|
||||
[Validation(Required=true)]
|
||||
public string ExtInfos { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
97
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeRefundResponse.cs
vendored
Normal file
97
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/AlipayTradeRefundResponse.cs
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class AlipayTradeRefundResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("buyer_logon_id")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerLogonId { get; set; }
|
||||
|
||||
[NameInMap("fund_change")]
|
||||
[Validation(Required=true)]
|
||||
public string FundChange { get; set; }
|
||||
|
||||
[NameInMap("refund_fee")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundFee { get; set; }
|
||||
|
||||
[NameInMap("refund_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundCurrency { get; set; }
|
||||
|
||||
[NameInMap("gmt_refund_pay")]
|
||||
[Validation(Required=true)]
|
||||
public string GmtRefundPay { get; set; }
|
||||
|
||||
[NameInMap("refund_detail_item_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<TradeFundBill> RefundDetailItemList { get; set; }
|
||||
|
||||
[NameInMap("store_name")]
|
||||
[Validation(Required=true)]
|
||||
public string StoreName { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_id")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserId { get; set; }
|
||||
|
||||
[NameInMap("refund_preset_paytool_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<PresetPayToolInfo> RefundPresetPaytoolList { get; set; }
|
||||
|
||||
[NameInMap("refund_settlement_id")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundSettlementId { get; set; }
|
||||
|
||||
[NameInMap("present_refund_buyer_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PresentRefundBuyerAmount { get; set; }
|
||||
|
||||
[NameInMap("present_refund_discount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PresentRefundDiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("present_refund_mdiscount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PresentRefundMdiscountAmount { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/PresetPayToolInfo.cs
vendored
Normal file
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/PresetPayToolInfo.cs
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class PresetPayToolInfo : TeaModel {
|
||||
[NameInMap("amount")]
|
||||
[Validation(Required=true)]
|
||||
public List<string> Amount { get; set; }
|
||||
|
||||
[NameInMap("assert_type_code")]
|
||||
[Validation(Required=true)]
|
||||
public string AssertTypeCode { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/RefundRoyaltyResult.cs
vendored
Normal file
42
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/RefundRoyaltyResult.cs
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class RefundRoyaltyResult : TeaModel {
|
||||
[NameInMap("refund_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string RefundAmount { get; set; }
|
||||
|
||||
[NameInMap("royalty_type")]
|
||||
[Validation(Required=true)]
|
||||
public string RoyaltyType { get; set; }
|
||||
|
||||
[NameInMap("result_code")]
|
||||
[Validation(Required=true)]
|
||||
public string ResultCode { get; set; }
|
||||
|
||||
[NameInMap("trans_out")]
|
||||
[Validation(Required=true)]
|
||||
public string TransOut { get; set; }
|
||||
|
||||
[NameInMap("trans_out_email")]
|
||||
[Validation(Required=true)]
|
||||
public string TransOutEmail { get; set; }
|
||||
|
||||
[NameInMap("trans_in")]
|
||||
[Validation(Required=true)]
|
||||
public string TransIn { get; set; }
|
||||
|
||||
[NameInMap("trans_in_email")]
|
||||
[Validation(Required=true)]
|
||||
public string TransInEmail { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
34
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/TradeFundBill.cs
vendored
Normal file
34
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/TradeFundBill.cs
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class TradeFundBill : TeaModel {
|
||||
[NameInMap("fund_channel")]
|
||||
[Validation(Required=true)]
|
||||
public string FundChannel { get; set; }
|
||||
|
||||
[NameInMap("bank_code")]
|
||||
[Validation(Required=true)]
|
||||
public string BankCode { get; set; }
|
||||
|
||||
[NameInMap("amount")]
|
||||
[Validation(Required=true)]
|
||||
public string Amount { get; set; }
|
||||
|
||||
[NameInMap("real_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string RealAmount { get; set; }
|
||||
|
||||
[NameInMap("fund_type")]
|
||||
[Validation(Required=true)]
|
||||
public string FundType { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
38
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/TradeSettleDetail.cs
vendored
Normal file
38
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/TradeSettleDetail.cs
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class TradeSettleDetail : TeaModel {
|
||||
[NameInMap("operation_type")]
|
||||
[Validation(Required=true)]
|
||||
public string OperationType { get; set; }
|
||||
|
||||
[NameInMap("operation_serial_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OperationSerial_no { get; set; }
|
||||
|
||||
[NameInMap("operation_dt")]
|
||||
[Validation(Required=true)]
|
||||
public string OperationDt { get; set; }
|
||||
|
||||
[NameInMap("trans_out")]
|
||||
[Validation(Required=true)]
|
||||
public string TransOut { get; set; }
|
||||
|
||||
[NameInMap("trans_in")]
|
||||
[Validation(Required=true)]
|
||||
public string TransIn { get; set; }
|
||||
|
||||
[NameInMap("amount")]
|
||||
[Validation(Required=true)]
|
||||
public string Amount { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
18
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/TradeSettleInfo.cs
vendored
Normal file
18
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Common/Models/TradeSettleInfo.cs
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Common.Models
|
||||
{
|
||||
public class TradeSettleInfo : TeaModel {
|
||||
[NameInMap("trade_settle_detail_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<TradeSettleDetail> TradeSettleDetailList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
536
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Client.cs
vendored
Normal file
536
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Client.cs
vendored
Normal file
@@ -0,0 +1,536 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Payment.FaceToFace.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.FaceToFace
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayTradePayResponse Pay(string subject, string outTradeNo, string totalAmount, string authCode)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.pay"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
{"auth_code", authCode},
|
||||
{"scene", "bar_code"},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.trade.pay");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePayResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePayResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayTradePayResponse> PayAsync(string subject, string outTradeNo, string totalAmount, string authCode)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.pay"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
{"auth_code", authCode},
|
||||
{"scene", "bar_code"},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.trade.pay");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePayResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePayResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public AlipayTradePrecreateResponse PreCreate(string subject, string outTradeNo, string totalAmount)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.precreate"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.trade.precreate");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePrecreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePrecreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayTradePrecreateResponse> PreCreateAsync(string subject, string outTradeNo, string totalAmount)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.precreate"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.trade.precreate");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePrecreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradePrecreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
165
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Models/AlipayTradePayResponse.cs
vendored
Normal file
165
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Models/AlipayTradePayResponse.cs
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.FaceToFace.Models
|
||||
{
|
||||
public class AlipayTradePayResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("buyer_logon_id")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerLogonId { get; set; }
|
||||
|
||||
[NameInMap("settle_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string SettleAmount { get; set; }
|
||||
|
||||
[NameInMap("pay_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string PayCurrency { get; set; }
|
||||
|
||||
[NameInMap("pay_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PayAmount { get; set; }
|
||||
|
||||
[NameInMap("settle_trans_rate")]
|
||||
[Validation(Required=true)]
|
||||
public string SettleTransRate { get; set; }
|
||||
|
||||
[NameInMap("trans_pay_rate")]
|
||||
[Validation(Required=true)]
|
||||
public string TransPayRate { get; set; }
|
||||
|
||||
[NameInMap("total_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string TotalAmount { get; set; }
|
||||
|
||||
[NameInMap("trans_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string TransCurrency { get; set; }
|
||||
|
||||
[NameInMap("settle_currency")]
|
||||
[Validation(Required=true)]
|
||||
public string SettleCurrency { get; set; }
|
||||
|
||||
[NameInMap("receipt_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string ReceiptAmount { get; set; }
|
||||
|
||||
[NameInMap("buyer_pay_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerPayAmount { get; set; }
|
||||
|
||||
[NameInMap("point_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string PointAmount { get; set; }
|
||||
|
||||
[NameInMap("invoice_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string InvoiceAmount { get; set; }
|
||||
|
||||
[NameInMap("gmt_payment")]
|
||||
[Validation(Required=true)]
|
||||
public string GmtPayment { get; set; }
|
||||
|
||||
[NameInMap("fund_bill_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<TradeFundBill> FundBillList { get; set; }
|
||||
|
||||
[NameInMap("card_balance")]
|
||||
[Validation(Required=true)]
|
||||
public string CardBalance { get; set; }
|
||||
|
||||
[NameInMap("store_name")]
|
||||
[Validation(Required=true)]
|
||||
public string StoreName { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_id")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserId { get; set; }
|
||||
|
||||
[NameInMap("discount_goods_detail")]
|
||||
[Validation(Required=true)]
|
||||
public string DiscountGoodsDetail { get; set; }
|
||||
|
||||
[NameInMap("voucher_detail_list")]
|
||||
[Validation(Required=true)]
|
||||
public List<VoucherDetail> VoucherDetailList { get; set; }
|
||||
|
||||
[NameInMap("advance_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string AdvanceAmount { get; set; }
|
||||
|
||||
[NameInMap("auth_trade_pay_mode")]
|
||||
[Validation(Required=true)]
|
||||
public string AuthTradePayMode { get; set; }
|
||||
|
||||
[NameInMap("charge_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string ChargeAmount { get; set; }
|
||||
|
||||
[NameInMap("charge_flags")]
|
||||
[Validation(Required=true)]
|
||||
public string ChargeFlags { get; set; }
|
||||
|
||||
[NameInMap("settlement_id")]
|
||||
[Validation(Required=true)]
|
||||
public string SettlementId { get; set; }
|
||||
|
||||
[NameInMap("business_params")]
|
||||
[Validation(Required=true)]
|
||||
public string BusinessParams { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_type")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserType { get; set; }
|
||||
|
||||
[NameInMap("mdiscount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string MdiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("discount_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string DiscountAmount { get; set; }
|
||||
|
||||
[NameInMap("buyer_user_name")]
|
||||
[Validation(Required=true)]
|
||||
public string BuyerUserName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.FaceToFace.Models
|
||||
{
|
||||
public class AlipayTradePrecreateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("qr_code")]
|
||||
[Validation(Required=true)]
|
||||
public string QrCode { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
30
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Models/TradeFundBill.cs
vendored
Normal file
30
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Models/TradeFundBill.cs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.FaceToFace.Models
|
||||
{
|
||||
public class TradeFundBill : TeaModel {
|
||||
[NameInMap("fund_channel")]
|
||||
[Validation(Required=true)]
|
||||
public string FundChannel { get; set; }
|
||||
|
||||
[NameInMap("bank_code")]
|
||||
[Validation(Required=true)]
|
||||
public string BankCode { get; set; }
|
||||
|
||||
[NameInMap("amount")]
|
||||
[Validation(Required=true)]
|
||||
public string Amount { get; set; }
|
||||
|
||||
[NameInMap("real_amount")]
|
||||
[Validation(Required=true)]
|
||||
public string RealAmount { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
58
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Models/VoucherDetail.cs
vendored
Normal file
58
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/FaceToFace/Models/VoucherDetail.cs
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.FaceToFace.Models
|
||||
{
|
||||
public class VoucherDetail : TeaModel {
|
||||
[NameInMap("id")]
|
||||
[Validation(Required=true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[NameInMap("name")]
|
||||
[Validation(Required=true)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[NameInMap("type")]
|
||||
[Validation(Required=true)]
|
||||
public string Type { get; set; }
|
||||
|
||||
[NameInMap("amount")]
|
||||
[Validation(Required=true)]
|
||||
public string Amount { get; set; }
|
||||
|
||||
[NameInMap("merchant_contribute")]
|
||||
[Validation(Required=true)]
|
||||
public string MerchantContribute { get; set; }
|
||||
|
||||
[NameInMap("other_contribute")]
|
||||
[Validation(Required=true)]
|
||||
public string OtherContribute { get; set; }
|
||||
|
||||
[NameInMap("memo")]
|
||||
[Validation(Required=true)]
|
||||
public string Memo { get; set; }
|
||||
|
||||
[NameInMap("template_id")]
|
||||
[Validation(Required=true)]
|
||||
public string TemplateId { get; set; }
|
||||
|
||||
[NameInMap("purchase_buyer_contribute")]
|
||||
[Validation(Required=true)]
|
||||
public string PurchaseBuyerContribute { get; set; }
|
||||
|
||||
[NameInMap("purchase_merchant_contribute")]
|
||||
[Validation(Required=true)]
|
||||
public string PurchaseMerchantContribute { get; set; }
|
||||
|
||||
[NameInMap("purchase_ant_contribute")]
|
||||
[Validation(Required=true)]
|
||||
public string PurchaseAntContribute { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
324
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Huabei/Client.cs
vendored
Normal file
324
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Huabei/Client.cs
vendored
Normal file
@@ -0,0 +1,324 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Payment.Huabei.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Huabei
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayTradeCreateResponse Create(string subject, string outTradeNo, string totalAmount, string buyerId, HuabeiConfig extendParams)
|
||||
{
|
||||
extendParams.Validate();
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
{"buyer_id", buyerId},
|
||||
{"extend_params", extendParams},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.trade.create");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayTradeCreateResponse> CreateAsync(string subject, string outTradeNo, string totalAmount, string buyerId, HuabeiConfig extendParams)
|
||||
{
|
||||
extendParams.Validate();
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
{"buyer_id", buyerId},
|
||||
{"extend_params", extendParams},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.trade.create");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayTradeCreateResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
45
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Huabei/Models/AlipayTradeCreateResponse.cs
vendored
Normal file
45
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Huabei/Models/AlipayTradeCreateResponse.cs
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Huabei.Models
|
||||
{
|
||||
public class AlipayTradeCreateResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("out_trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string OutTradeNo { get; set; }
|
||||
|
||||
[NameInMap("trade_no")]
|
||||
[Validation(Required=true)]
|
||||
public string TradeNo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Huabei/Models/HuabeiConfig.cs
vendored
Normal file
22
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Huabei/Models/HuabeiConfig.cs
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Huabei.Models
|
||||
{
|
||||
public class HuabeiConfig : TeaModel {
|
||||
[NameInMap("hb_fq_num")]
|
||||
[Validation(Required=true)]
|
||||
public string HbFqNum { get; set; }
|
||||
|
||||
[NameInMap("hb_fq_seller_percent")]
|
||||
[Validation(Required=true)]
|
||||
public string HbFqSellerPercent { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
139
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Page/Client.cs
vendored
Normal file
139
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Page/Client.cs
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Payment.Page.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Page
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
|
||||
public AlipayTradePagePayResponse Pay(string subject, string outTradeNo, string totalAmount, string returnUrl)
|
||||
{
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.page.pay"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
{"product_code", "FAST_INSTANT_TRADE_PAY"},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"return_url", returnUrl},
|
||||
};
|
||||
string sign = this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"));
|
||||
Dictionary<string, string> response = new Dictionary<string, string>
|
||||
{
|
||||
{"body", this._kernel.GeneratePage("POST", systemParams, bizParams, textParams, sign)},
|
||||
};
|
||||
return TeaModel.ToObject<AlipayTradePagePayResponse>(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Page/Models/AlipayTradePagePayResponse.cs
vendored
Normal file
21
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Page/Models/AlipayTradePagePayResponse.cs
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Page.Models
|
||||
{
|
||||
public class AlipayTradePagePayResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 订单信息,Form表单形式
|
||||
/// </summary>
|
||||
[NameInMap("body")]
|
||||
[Validation(Required=true)]
|
||||
public string Body { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
140
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Wap/Client.cs
vendored
Normal file
140
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Wap/Client.cs
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Payment.Wap.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Wap
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
|
||||
public AlipayTradeWapPayResponse Pay(string subject, string outTradeNo, string totalAmount, string quitUrl, string returnUrl)
|
||||
{
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.trade.wap.pay"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"subject", subject},
|
||||
{"out_trade_no", outTradeNo},
|
||||
{"total_amount", totalAmount},
|
||||
{"quit_url", quitUrl},
|
||||
{"product_code", "QUICK_WAP_WAY"},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>
|
||||
{
|
||||
{"return_url", returnUrl},
|
||||
};
|
||||
string sign = this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"));
|
||||
Dictionary<string, string> response = new Dictionary<string, string>
|
||||
{
|
||||
{"body", this._kernel.GeneratePage("POST", systemParams, bizParams, textParams, sign)},
|
||||
};
|
||||
return TeaModel.ToObject<AlipayTradeWapPayResponse>(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Wap/Models/AlipayTradeWapPayResponse.cs
vendored
Normal file
21
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Payment/Wap/Models/AlipayTradeWapPayResponse.cs
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Payment.Wap.Models
|
||||
{
|
||||
public class AlipayTradeWapPayResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 订单信息,Form表单形式
|
||||
/// </summary>
|
||||
[NameInMap("body")]
|
||||
[Validation(Required=true)]
|
||||
public string Body { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
314
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Security/TextRisk/Client.cs
vendored
Normal file
314
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Security/TextRisk/Client.cs
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Security.TextRisk.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Security.TextRisk
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipaySecurityRiskContentDetectResponse Detect(string content)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.security.risk.content.detect"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"content", content},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, "alipay.security.risk.content.detect");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySecurityRiskContentDetectResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySecurityRiskContentDetectResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipaySecurityRiskContentDetectResponse> DetectAsync(string content)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", "alipay.security.risk.content.detect"},
|
||||
{"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()},
|
||||
};
|
||||
Dictionary<string, object> bizParams = new Dictionary<string, object>
|
||||
{
|
||||
{"content", content},
|
||||
};
|
||||
Dictionary<string, string> textParams = new Dictionary<string, string>(){};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, "alipay.security.risk.content.detect");
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySecurityRiskContentDetectResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipaySecurityRiskContentDetectResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Security.TextRisk.Models
|
||||
{
|
||||
public class AlipaySecurityRiskContentDetectResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
[NameInMap("action")]
|
||||
[Validation(Required=true)]
|
||||
public string Action { get; set; }
|
||||
|
||||
[NameInMap("keywords")]
|
||||
[Validation(Required=true)]
|
||||
public List<string> Keywords { get; set; }
|
||||
|
||||
[NameInMap("unique_id")]
|
||||
[Validation(Required=true)]
|
||||
public string UniqueId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
114
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Util/AES/Client.cs
vendored
Normal file
114
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Util/AES/Client.cs
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
|
||||
namespace Alipay.EasySDK.Util.AES
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
|
||||
public string Decrypt(string cipherText)
|
||||
{
|
||||
return this._kernel.AesDecrypt(cipherText, this._kernel.GetConfig("encryptKey"));
|
||||
}
|
||||
|
||||
public string Encrypt(string plainText)
|
||||
{
|
||||
return this._kernel.AesEncrypt(plainText, this._kernel.GetConfig("encryptKey"));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
304
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Util/Generic/Client.cs
vendored
Normal file
304
vendor/alipaysdk/easysdk/csharp/AlipayEasySDK/Util/Generic/Client.cs
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tea;
|
||||
using Tea.Utils;
|
||||
|
||||
using Alipay.EasySDK.Util.Generic.Models;
|
||||
|
||||
namespace Alipay.EasySDK.Util.Generic
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
protected Alipay.EasySDK.Kernel.Client _kernel;
|
||||
|
||||
public Client(Alipay.EasySDK.Kernel.Client kernel)
|
||||
{
|
||||
this._kernel = kernel;
|
||||
}
|
||||
|
||||
public AlipayOpenApiGenericResponse Execute(string method, Dictionary<string, string> textParams, Dictionary<string, object> bizParams)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", method},
|
||||
{"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()},
|
||||
};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = TeaCore.DoAction(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = this._kernel.ReadAsJson(response_, method);
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenApiGenericResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenApiGenericResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
public async Task<AlipayOpenApiGenericResponse> ExecuteAsync(string method, Dictionary<string, string> textParams, Dictionary<string, object> bizParams)
|
||||
{
|
||||
Dictionary<string, object> runtime_ = new Dictionary<string, object>
|
||||
{
|
||||
{"ignoreSSL", this._kernel.GetConfig("ignoreSSL")},
|
||||
{"httpProxy", this._kernel.GetConfig("httpProxy")},
|
||||
{"connectTimeout", 15000},
|
||||
{"readTimeout", 15000},
|
||||
{"retry", new Dictionary<string, int?>
|
||||
{
|
||||
{"maxAttempts", 0},
|
||||
}},
|
||||
};
|
||||
|
||||
TeaRequest _lastRequest = null;
|
||||
Exception _lastException = null;
|
||||
long _now = System.DateTime.Now.Millisecond;
|
||||
int _retryTimes = 0;
|
||||
while (TeaCore.AllowRetry((IDictionary) runtime_["retry"], _retryTimes, _now))
|
||||
{
|
||||
if (_retryTimes > 0)
|
||||
{
|
||||
int backoffTime = TeaCore.GetBackoffTime((IDictionary)runtime_["backoff"], _retryTimes);
|
||||
if (backoffTime > 0)
|
||||
{
|
||||
TeaCore.Sleep(backoffTime);
|
||||
}
|
||||
}
|
||||
_retryTimes = _retryTimes + 1;
|
||||
try
|
||||
{
|
||||
TeaRequest request_ = new TeaRequest();
|
||||
Dictionary<string, string> systemParams = new Dictionary<string, string>
|
||||
{
|
||||
{"method", method},
|
||||
{"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()},
|
||||
};
|
||||
request_.Protocol = this._kernel.GetConfig("protocol");
|
||||
request_.Method = "POST";
|
||||
request_.Pathname = "/gateway.do";
|
||||
request_.Headers = new Dictionary<string, string>
|
||||
{
|
||||
{"host", this._kernel.GetConfig("gatewayHost")},
|
||||
{"content-type", "application/x-www-form-urlencoded;charset=utf-8"},
|
||||
};
|
||||
request_.Query = this._kernel.SortMap(TeaConverter.merge<string>
|
||||
(
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"sign", this._kernel.Sign(systemParams, bizParams, textParams, this._kernel.GetConfig("merchantPrivateKey"))},
|
||||
},
|
||||
systemParams,
|
||||
textParams
|
||||
));
|
||||
request_.Body = TeaCore.BytesReadable(this._kernel.ToUrlEncodedRequestBody(bizParams));
|
||||
_lastRequest = request_;
|
||||
TeaResponse response_ = await TeaCore.DoActionAsync(request_, runtime_);
|
||||
|
||||
Dictionary<string, object> respMap = await this._kernel.ReadAsJsonAsync(response_, method);
|
||||
if (this._kernel.IsCertMode())
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.ExtractAlipayPublicKey(this._kernel.GetAlipayCertSN(respMap))))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenApiGenericResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._kernel.Verify(respMap, this._kernel.GetConfig("alipayPublicKey")))
|
||||
{
|
||||
return TeaModel.ToObject<AlipayOpenApiGenericResponse>(this._kernel.ToRespModel(respMap));
|
||||
}
|
||||
}
|
||||
throw new TeaException(new Dictionary<string, string>
|
||||
{
|
||||
{"message", "验签失败,请检查支付宝公钥设置是否正确。"},
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (TeaCore.IsRetryable(e))
|
||||
{
|
||||
_lastException = e;
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TeaUnretryableException(_lastRequest, _lastException);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ISV代商户代用,指定appAuthToken
|
||||
/// </summary>
|
||||
/// <param name="appAuthToken">代调用token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Agent(string appAuthToken)
|
||||
{
|
||||
_kernel.InjectTextParam("app_auth_token", appAuthToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权调用,指定authToken
|
||||
/// </summary>
|
||||
/// <param name="authToken">用户授权token</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Auth(string authToken)
|
||||
{
|
||||
_kernel.InjectTextParam("auth_token", authToken);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步通知回调地址,此处设置将在本调用中覆盖Config中的全局配置
|
||||
/// </summary>
|
||||
/// <param name="url">异步通知回调地址,例如:https://www.test.com/callback </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client AsyncNotify(string url)
|
||||
{
|
||||
_kernel.InjectTextParam("notify_url", url);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将本次调用强制路由到后端系统的测试地址上,常用于线下环境内外联调,沙箱与线上环境设置无效
|
||||
/// </summary>
|
||||
/// <param name="testUrl">后端系统测试地址</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Route(string testUrl)
|
||||
{
|
||||
_kernel.InjectTextParam("ws_service_url", testUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// </summary>
|
||||
/// <param name="key">业务请求参数名称(biz_content下的字段名,比如timeout_express)</param>
|
||||
/// <param name="value">
|
||||
/// 业务请求参数的值,一个可以序列化成JSON的对象
|
||||
/// 如果该字段是一个字符串类型(String、Price、Date在SDK中都是字符串),请使用string储存
|
||||
/// 如果该字段是一个数值型类型(比如:Number),请使用long储存
|
||||
/// 如果该字段是一个复杂类型,请使用嵌套的Dictionary指定各下级字段的值
|
||||
/// 如果该字段是一个数组,请使用List储存各个值
|
||||
/// 对于更复杂的情况,也支持Dictionary和List的各种组合嵌套,比如参数是值是个List,List中的每种类型是一个复杂对象
|
||||
/// </param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client Optional(string key, object value)
|
||||
{
|
||||
_kernel.InjectBizParam(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量设置API入参中没有的其他可选业务请求参数(biz_content下的字段)
|
||||
/// optional方法的批量版本
|
||||
/// </summary>
|
||||
/// <param name="optionalArgs">可选参数集合,每个参数由key和value组成,key和value的格式请参见optional方法的注释</param>
|
||||
/// <returns>本客户端,便于链式调用</returns>
|
||||
public Client BatchOptional(Dictionary<string, object> optionalArgs)
|
||||
{
|
||||
foreach (var pair in optionalArgs)
|
||||
{
|
||||
_kernel.InjectBizParam(pair.Key, pair.Value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Tea;
|
||||
|
||||
namespace Alipay.EasySDK.Util.Generic.Models
|
||||
{
|
||||
public class AlipayOpenApiGenericResponse : TeaModel {
|
||||
/// <summary>
|
||||
/// 响应原始字符串
|
||||
/// </summary>
|
||||
[NameInMap("http_body")]
|
||||
[Validation(Required=true)]
|
||||
public string HttpBody { get; set; }
|
||||
|
||||
[NameInMap("code")]
|
||||
[Validation(Required=true)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[NameInMap("msg")]
|
||||
[Validation(Required=true)]
|
||||
public string Msg { get; set; }
|
||||
|
||||
[NameInMap("sub_code")]
|
||||
[Validation(Required=true)]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
[NameInMap("sub_msg")]
|
||||
[Validation(Required=true)]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user