146 lines
4.9 KiB
C#
146 lines
4.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace WebService.SDK.PayCommon
|
|
{
|
|
/// <summary>
|
|
/// 门店移动支付相关配置
|
|
/// </summary>
|
|
public class MobilePayConfig
|
|
{
|
|
/// <summary>
|
|
/// 平台商户信息列表
|
|
/// </summary>
|
|
public Dictionary<string, Dictionary<string, PayMerchant>> MerchantList { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平台商户信息
|
|
/// </summary>
|
|
public class PayMerchant
|
|
{
|
|
/// <summary>
|
|
/// 平台商户号
|
|
/// </summary>
|
|
public string MerchantCode { get; set; }
|
|
/// <summary>
|
|
/// APPID
|
|
/// </summary>
|
|
public string MerchantAPPID { get; set; }
|
|
/// <summary>
|
|
/// 平台商户密钥
|
|
/// </summary>
|
|
public string MerchantKey { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平台商户柜台号
|
|
/// </summary>
|
|
public string MerchantPosCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平台门店编号
|
|
/// </summary>
|
|
public string MerchantShopCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平台员工编号
|
|
/// </summary>
|
|
public string MerchantUserCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 交易证书密码
|
|
/// </summary>
|
|
public string CertPassword { get; set; }
|
|
|
|
/// <summary>
|
|
/// 操作员号
|
|
/// </summary>
|
|
public string UserID { get; set; }
|
|
|
|
/// <summary>
|
|
/// 操作员密码
|
|
/// </summary>
|
|
public string UserPassword { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 付付支付参数
|
|
/// </summary>
|
|
public class FFDZPay
|
|
{
|
|
/// <summary>
|
|
/// 付付支付URL主地址
|
|
/// </summary>
|
|
public const string BASE_URL = "https://trans.ffdzpay.com/gateway/pay";
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 客无忧支付参数
|
|
/// </summary>
|
|
public class KWYPay
|
|
{
|
|
/// <summary>
|
|
/// 客无忧支付URL主地址
|
|
/// </summary>
|
|
public const string BASE_URL = "https://www.weiwoju.com/Payapi/Index";
|
|
/// <summary>
|
|
/// 客无忧签名密钥
|
|
/// </summary>
|
|
public const string ApiKey = "w0j23q2m69po13syyd6pj6a11o64f2r13bj";
|
|
/// <summary>
|
|
/// 客无忧平台OpenID
|
|
/// </summary>
|
|
public const string ApiOpenID = "1z7n0lp0nsi8o0dd5o74lgrhs1575k";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 门店通道配置获取
|
|
/// </summary>
|
|
/// <param name="oracleHelper">数据库连接类</param>
|
|
/// <param name="serverPartCode">服务区编码</param>
|
|
/// <param name="businessType">业态编码</param>
|
|
/// <returns></returns>
|
|
public static string ShopPaymentConfig(OracleHelper oracleHelper, string serverPartCode, string businessType)
|
|
{
|
|
DataTable _ConfigTable = new DataTable();
|
|
_ConfigTable.Columns.Add("k", typeof(string));
|
|
_ConfigTable.Columns.Add("v", typeof(string));
|
|
string _strSelect = string.Format(@"SELECT PAYMENT_CHANNEL
|
|
FROM HIGHWAY_EXCHANGE.T_MOBILEPAYCODE
|
|
WHERE SERVERPART_CODE = '{0}' AND BUSINESSTYPE = '{1}'",
|
|
serverPartCode, businessType);
|
|
try
|
|
{
|
|
DataTable _DataTable = oracleHelper.ExcuteSqlGetDataSet(_strSelect).Tables[0];
|
|
if (_DataTable != null && _DataTable.Rows.Count > 0)
|
|
{
|
|
string _PaymentChannel = _DataTable.Rows[0]["PAYMENT_CHANNEL"].ToString();
|
|
if (!string.IsNullOrWhiteSpace(_PaymentChannel))
|
|
{
|
|
string[] _Payment = _PaymentChannel.Split(',');
|
|
for (int i = 0; i < _Payment.Count(); i++)
|
|
{
|
|
if (_Payment[i].Split('|').Count() > 1)
|
|
{
|
|
if (i == 0)
|
|
{
|
|
_ConfigTable.Rows.Add("MobilePayOperators", _Payment[i].Split('|')[0]);
|
|
}
|
|
_ConfigTable.Rows.Add("service_port" + (i == 0 ? "" : (i + 1).ToString()), _Payment[i].Split('|')[1]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteSendLog(ex.Message);
|
|
}
|
|
return JSonHelper.DataTableToJson(_ConfigTable, "Configuration");
|
|
}
|
|
}
|
|
}
|