COneSDK.Client 3.1.1

dotnet add package COneSDK.Client --version 3.1.1
                    
NuGet\Install-Package COneSDK.Client -Version 3.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="COneSDK.Client" Version="3.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="COneSDK.Client" Version="3.1.1" />
                    
Directory.Packages.props
<PackageReference Include="COneSDK.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add COneSDK.Client --version 3.1.1
                    
#r "nuget: COneSDK.Client, 3.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package COneSDK.Client@3.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=COneSDK.Client&version=3.1.1
                    
Install as a Cake Addin
#tool nuget:?package=COneSDK.Client&version=3.1.1
                    
Install as a Cake Tool

COneSDK.Client

NuGet version (COneSDK.Client)

COneSDK.Client is an SDKClient tool that provides capability to access increator's front-end gateways for .NET
COneSDK.Client是一个.NET语言编写的SDKClient工具,提供接入创建前置网关能力

V2版本协议——BaseCJRequest

//初始化配置类
COneOption config = new COneOption()
{
    //服务地址
    ServUrl = "https://127.0.0.1:8000/WorkService/do",
    //接入授权机构
    AppBizId = "90010009",
    //关键字密钥
    CipherKey = "CA8A8FBD968580CA2C867F79F97AB05D",
    //报文校验方式
    SignType = SignMethodType.SM2,
    //服务平台公钥
    PlatformPubKey = "042E4B05453967BB8EEA4DF417702C9517E60D19E41D5898B4DC599CE9FCFCAD7A2B363A316DD8089B40ED20371BD03BEC50C44C9E2CD9E035A7E4025D428B1CB9",
    //商户私钥
    MerchantPriKey = "3D8FD6E50DEE5C132ACCC71C196EFBCBC461FC9901203162A8477505C992C1D1"
};
//初始化客户端
ICOneClient client = new COneClient(config);
//初始化请求对象 指定交易代码
var request = new BaseCJRequest() { FunCode = "1001" };
//赋值属性值
request["bizid"] = "330903000000031";
//若需要加密,设置加密字段
request.SetCipherField(new string[] { "name" }, CipherMethod.SM4);
request["name"] = "中国人";
//异步执行接口调用,返回调用对象
var response = await client.ExecuteAsync<BaseCJResponse>(request);
//同步执行接口调用,返回调用对象
//var response = client.Execute<BaseCJResponse>(request);
//判断结果是否成功
if (!response.IsSuccess)
{
	//do some rollback work
	Console.WriteLine(response.RetCode + "|" + response.RetMsg);	
	return;
}
//取应答对象属性值 进行具体业务操作
//	Console.WriteLine(response["status"]);

Gateway版本协议——BaseGatewayRequest

//初始化配置类
COneOption config = new COneOption()
{
    //服务地址
    ServUrl = "https://localhost:5000/upay/gateway.do",
    //接入授权机构
    AppBizId = "90010005",
    //关键字密钥
    CipherKey = "CA8A8FBD968580CA2C867F79F97AB05D",
    //报文校验方式
    SignType = SignMethodType.SM2,
    //服务平台公钥
    PlatformPubKey = "042E4B05453967BB8EEA4DF417702C9517E60D19E41D5898B4DC599CE9FCFCAD7A2B363A316DD8089B40ED20371BD03BEC50C44C9E2CD9E035A7E4025D428B1CB9",
    //商户私钥
    MerchantPriKey = "3D8FD6E50DEE5C132ACCC71C196EFBCBC461FC9901203162A8477505C992C1D1"
};
//初始化客户端
ICOneClient client = new COneClient(config);
//初始化请求对象 指定交易代码
var request = new BaseGatewayRequest() { FunCode = "2023" };
//赋值属性值
request["channel"] = "000000";
request["userid"] = "smk0090000000001";
request["appver"] = "010203";
request["phonever"] = "IPhone18";
request["lat"] = "0";
request["lng"] = "0";
//若需要加密,设置加密字段
request.SetCipherField(new string[] { "userid" }, CipherMethod.SM4);
request["userid"] = "中国人";
//异步执行接口调用,返回调用对象
var response = await client.ExecuteAsync(request);
//同步执行接口调用,返回调用对象
//var response = client.Execute(request);
//判断结果是否成功
if (!response.IsSuccess)
{
	//do some rollback work
	Console.WriteLine(response.RetCode + "|" + response.RetMsg);	
	return;
}
//取应答对象属性值 进行具体业务操作
//	Console.WriteLine(response["status"]);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.1 295 8/25/2023
3.1.0 281 8/9/2023
3.0.0 454 9/14/2022

加入网关协议报文上传下载文件支持