99 lines
3.1 KiB
C#
99 lines
3.1 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
|
||
namespace WebService.SDK.ICBCPay
|
||
{
|
||
public class ICBCPayConfig
|
||
{
|
||
/// <summary>
|
||
/// 工行支付平台API主地址
|
||
/// </summary>
|
||
private string ICBCPayURL { get; }
|
||
|
||
/// <summary>
|
||
/// 支付平台连接超时时间
|
||
/// 单位:秒
|
||
/// </summary>
|
||
public int PlatformTimeout { get; }
|
||
|
||
/// <summary>
|
||
/// 工行支付平台APPID
|
||
/// </summary>
|
||
public string ICBCAPPID { get; }
|
||
|
||
/// <summary>
|
||
/// 工行用户加密私钥
|
||
/// </summary>
|
||
public string UserPrivateKey { get; }
|
||
|
||
/// <summary>
|
||
/// 工行用户加密公钥
|
||
/// </summary>
|
||
public string UserPublicKey { get; }
|
||
|
||
/// <summary>
|
||
/// 工行支付平台签名Key
|
||
/// </summary>
|
||
public string ICBCPublicKey { get; }
|
||
|
||
/// <summary>
|
||
/// 工行支付平台签名类型
|
||
/// </summary>
|
||
public string PlatformSignType { get; } = "rsa";
|
||
|
||
/// <summary>
|
||
/// 工行支付平台主商户号
|
||
/// </summary>
|
||
public string Organization { get; }
|
||
|
||
/// <summary>
|
||
/// 工行支付平台接口版本
|
||
/// </summary>
|
||
public string APIVersion { get; } = "1";
|
||
|
||
/// <summary>
|
||
/// 被扫支付接口地址
|
||
/// </summary>
|
||
public string ScanURL => ICBCPayURL + "/api/qrcode/V2/pay";
|
||
|
||
/// <summary>
|
||
/// 交易查询接口地址
|
||
/// </summary>
|
||
public string QueryURL => ICBCPayURL + "/api/qrcode/V2/query";
|
||
|
||
/// <summary>
|
||
/// 交易退款接口地址
|
||
/// </summary>
|
||
public string PayRefundURL => ICBCPayURL + "/api/qrcode/V2/reject";
|
||
|
||
/// <summary>
|
||
/// 交易退款查询接口地址
|
||
/// </summary>
|
||
public string PayQueryRefundURL => ICBCPayURL + "/api/qrcode/reject/query/V3";
|
||
|
||
/// <summary>
|
||
/// 工行支付平台API参数初始化
|
||
/// </summary>
|
||
/// <param name="icbcAPPID">工行支付平台APPID</param>
|
||
/// <param name="userPrivateKey">工行支付平台用户私钥</param>
|
||
/// <param name="userPublicKey">工行支付平台用户公钥</param>
|
||
/// <param name="icbcPublicKey">工行支付平台签名公钥</param>
|
||
/// <param name="organization">工行支付平台分行号</param>
|
||
/// <param name="icbcPayURL">工行支付平台API主地址</param>
|
||
/// <param name="platformTimeout">平台API连接超时时间(秒)</param>
|
||
public ICBCPayConfig(string icbcAPPID, string userPrivateKey,string userPublicKey, string icbcPublicKey, string organization,
|
||
string icbcPayURL = "https://gw.open.icbc.com.cn", int platformTimeout = 5)
|
||
{
|
||
ICBCAPPID = icbcAPPID;
|
||
UserPrivateKey = userPrivateKey;
|
||
UserPublicKey = userPublicKey;
|
||
ICBCPublicKey = icbcPublicKey;
|
||
Organization = organization;
|
||
ICBCPayURL = icbcPayURL;
|
||
PlatformTimeout = platformTimeout;
|
||
}
|
||
}
|
||
}
|