using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; namespace WebService.SDK.PayCommon { /// /// 门店移动支付相关配置 /// public class MobilePayConfig { /// /// 平台商户信息列表 /// public Dictionary> MerchantList { get; set; } /// /// 平台商户信息 /// public class PayMerchant { /// /// 平台商户号 /// public string MerchantCode { get; set; } /// /// APPID /// public string MerchantAPPID { get; set; } /// /// 平台商户密钥 /// public string MerchantKey { get; set; } /// /// 平台商户柜台号 /// public string MerchantPosCode { get; set; } /// /// 平台门店编号 /// public string MerchantShopCode { get; set; } /// /// 平台员工编号 /// public string MerchantUserCode { get; set; } /// /// 交易证书密码 /// public string CertPassword { get; set; } /// /// 操作员号 /// public string UserID { get; set; } /// /// 操作员密码 /// public string UserPassword { get; set; } } /// /// 付付支付参数 /// public class FFDZPay { /// /// 付付支付URL主地址 /// public const string BASE_URL = "https://trans.ffdzpay.com/gateway/pay"; } /// /// 客无忧支付参数 /// public class KWYPay { /// /// 客无忧支付URL主地址 /// public const string BASE_URL = "https://www.weiwoju.com/Payapi/Index"; /// /// 客无忧签名密钥 /// public const string ApiKey = "w0j23q2m69po13syyd6pj6a11o64f2r13bj"; /// /// 客无忧平台OpenID /// public const string ApiOpenID = "1z7n0lp0nsi8o0dd5o74lgrhs1575k"; } /// /// 门店通道配置获取 /// /// 数据库连接类 /// 服务区编码 /// 业态编码 /// 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"); } } }