|
@@ -140,24 +140,24 @@ namespace MySystem
|
|
|
Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
|
headers.Add("X-Client-ID", clientId);
|
|
headers.Add("X-Client-ID", clientId);
|
|
|
headers.Add("X-Security", "RSA");
|
|
headers.Add("X-Security", "RSA");
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
|
|
|
Dictionary<string, object> obj = new Dictionary<string, object>();
|
|
Dictionary<string, object> obj = new Dictionary<string, object>();
|
|
|
obj.Add("merNo", merNo);
|
|
obj.Add("merNo", merNo);
|
|
|
obj.Add("sn", sn);
|
|
obj.Add("sn", sn);
|
|
|
obj.Add("batchUpdateType", 2);
|
|
obj.Add("batchUpdateType", 2);
|
|
|
obj.Add("rateDOs", rateDOs);
|
|
obj.Add("rateDOs", rateDOs);
|
|
|
string content = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
string content = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
|
|
|
|
|
- function.WriteLog(content, "设置金控机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
|
|
|
|
|
+ Utils.WriteLog(content, "设置金控机具费率");
|
|
|
content = Encrypt2(content);
|
|
content = Encrypt2(content);
|
|
|
string signstr = Sign(content);
|
|
string signstr = Sign(content);
|
|
|
headers.Add("X-Sign", signstr);
|
|
headers.Add("X-Sign", signstr);
|
|
|
string headerString = Newtonsoft.Json.JsonConvert.SerializeObject(headers);
|
|
string headerString = Newtonsoft.Json.JsonConvert.SerializeObject(headers);
|
|
|
- function.WriteLog(headerString, "设置金控机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(headerString, "设置金控机具费率");
|
|
|
string req = "{\"param\":\"" + content + "\"}";
|
|
string req = "{\"param\":\"" + content + "\"}";
|
|
|
- function.WriteLog(req, "设置金控机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(req, "设置金控机具费率");
|
|
|
string result = function.PostWebRequest(reqUrl2, req, headers, "application/json");
|
|
string result = function.PostWebRequest(reqUrl2, req, headers, "application/json");
|
|
|
- function.WriteLog(result, "设置金控机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(result, "设置金控机具费率");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
public Dictionary<string, object> CallBack()
|
|
public Dictionary<string, object> CallBack()
|
|
@@ -334,9 +334,9 @@ namespace MySystem
|
|
|
string ret = string.Empty;
|
|
string ret = string.Empty;
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "请求开店宝API日志");
|
|
|
|
|
- function.WriteLog(postUrl, "请求开店宝API日志");
|
|
|
|
|
- function.WriteLog(paramData, "请求开店宝API日志");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "请求开店宝API日志");
|
|
|
|
|
+ Utils.WriteLog(postUrl, "请求开店宝API日志");
|
|
|
|
|
+ Utils.WriteLog(paramData, "请求开店宝API日志");
|
|
|
byte[] postData = System.Text.Encoding.UTF8.GetBytes(paramData);
|
|
byte[] postData = System.Text.Encoding.UTF8.GetBytes(paramData);
|
|
|
// 设置提交的相关参数
|
|
// 设置提交的相关参数
|
|
|
System.Net.HttpWebRequest request = System.Net.WebRequest.Create(postUrl) as System.Net.HttpWebRequest;
|
|
System.Net.HttpWebRequest request = System.Net.WebRequest.Create(postUrl) as System.Net.HttpWebRequest;
|
|
@@ -367,7 +367,7 @@ namespace MySystem
|
|
|
srcString = reader.ReadToEnd();
|
|
srcString = reader.ReadToEnd();
|
|
|
ret = srcString; //返回值赋值
|
|
ret = srcString; //返回值赋值
|
|
|
reader.Close();
|
|
reader.Close();
|
|
|
- function.WriteLog(srcString, "请求开店宝API日志");
|
|
|
|
|
|
|
+ Utils.WriteLog(srcString, "请求开店宝API日志");
|
|
|
}
|
|
}
|
|
|
catch (System.Net.WebException ex)
|
|
catch (System.Net.WebException ex)
|
|
|
{
|
|
{
|
|
@@ -381,7 +381,7 @@ namespace MySystem
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
ret = "fail";
|
|
ret = "fail";
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求开店宝API异常");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求开店宝API异常");
|
|
|
}
|
|
}
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
@@ -553,11 +553,11 @@ namespace MySystem
|
|
|
string signstr = LiSSign(content);
|
|
string signstr = LiSSign(content);
|
|
|
dic.Add("signData", signstr);
|
|
dic.Add("signData", signstr);
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(dic);
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(dic);
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置立刷费率");
|
|
|
|
|
- function.WriteLog(req, "设置立刷费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置立刷费率");
|
|
|
|
|
+ Utils.WriteLog(req, "设置立刷费率");
|
|
|
string result = PostWebRequest(LiSReqUrl + "FEE003", req, new Dictionary<string, string>());
|
|
string result = PostWebRequest(LiSReqUrl + "FEE003", req, new Dictionary<string, string>());
|
|
|
- function.WriteLog(result, "设置立刷费率");
|
|
|
|
|
- function.WriteLog("\n\n", "设置立刷费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(result, "设置立刷费率");
|
|
|
|
|
+ Utils.WriteLog("\n\n", "设置立刷费率");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -629,9 +629,9 @@ namespace MySystem
|
|
|
}
|
|
}
|
|
|
signString = signString.TrimEnd('&');
|
|
signString = signString.TrimEnd('&');
|
|
|
req.Add("mac", SftEncrypt(signString));
|
|
req.Add("mac", SftEncrypt(signString));
|
|
|
- function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(req), "设置盛付通机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(req), "设置盛付通机具服务费");
|
|
|
string result = function.PostWebRequest(SftReqUrl + "batchUpdateSnPolicyNo", Newtonsoft.Json.JsonConvert.SerializeObject(req), "application/json");
|
|
string result = function.PostWebRequest(SftReqUrl + "batchUpdateSnPolicyNo", Newtonsoft.Json.JsonConvert.SerializeObject(req), "application/json");
|
|
|
- function.WriteLog(result + "\n\n", "设置盛付通机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(result + "\n\n", "设置盛付通机具服务费");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -671,9 +671,9 @@ namespace MySystem
|
|
|
}
|
|
}
|
|
|
signString = signString.TrimEnd('&');
|
|
signString = signString.TrimEnd('&');
|
|
|
req.Add("mac", SftEncrypt(signString));
|
|
req.Add("mac", SftEncrypt(signString));
|
|
|
- function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(req), "设置盛付通机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(req), "设置盛付通机具费率");
|
|
|
string result = function.PostWebRequest(SftReqUrl + "batchChangeMerchantFee", Newtonsoft.Json.JsonConvert.SerializeObject(req), "application/json");
|
|
string result = function.PostWebRequest(SftReqUrl + "batchChangeMerchantFee", Newtonsoft.Json.JsonConvert.SerializeObject(req), "application/json");
|
|
|
- function.WriteLog(result + "\n\n", "设置盛付通机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(result + "\n\n", "设置盛付通机具费率");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -839,8 +839,8 @@ namespace MySystem
|
|
|
|
|
|
|
|
public string LDServiceFee(string SnList, int ServiceFee, int BrandId)
|
|
public string LDServiceFee(string SnList, int ServiceFee, int BrandId)
|
|
|
{
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置联动机具服务费");
|
|
|
|
|
- function.WriteLog(SnList, "设置联动机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置联动机具服务费");
|
|
|
|
|
+ Utils.WriteLog(SnList, "设置联动机具服务费");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
string RequestId = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
string RequestId = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
|
string TerminalModeName = BrandId == 10 ? "DZA" : "DZDA";
|
|
string TerminalModeName = BrandId == 10 ? "DZA" : "DZDA";
|
|
@@ -852,22 +852,22 @@ namespace MySystem
|
|
|
reqdic.Add("terminalModeName", TerminalModeName); //终端模式名
|
|
reqdic.Add("terminalModeName", TerminalModeName); //终端模式名
|
|
|
reqdic.Add("fwfRate", ServiceFee); //服务费
|
|
reqdic.Add("fwfRate", ServiceFee); //服务费
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "设置联动机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(req, "设置联动机具服务费");
|
|
|
req = LDEncrypt(req);
|
|
req = LDEncrypt(req);
|
|
|
- function.WriteLog(req, "设置联动机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(req, "设置联动机具服务费");
|
|
|
Dictionary<string, object> datadic = new Dictionary<string, object>();
|
|
Dictionary<string, object> datadic = new Dictionary<string, object>();
|
|
|
datadic.Add("encryptedData", req);
|
|
datadic.Add("encryptedData", req);
|
|
|
string data = Newtonsoft.Json.JsonConvert.SerializeObject(datadic);
|
|
string data = Newtonsoft.Json.JsonConvert.SerializeObject(datadic);
|
|
|
- function.WriteLog("请求地址:" + LDRequestUrl + "terminalSelfDistribute", "设置联动机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog("请求地址:" + LDRequestUrl + "terminalSelfDistribute", "设置联动机具服务费");
|
|
|
string result = function.PostWebRequest(LDRequestUrl + "terminalSelfDistribute", data, "application/json");
|
|
string result = function.PostWebRequest(LDRequestUrl + "terminalSelfDistribute", data, "application/json");
|
|
|
- function.WriteLog(result + "\n\n", "设置联动机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(result + "\n\n", "设置联动机具服务费");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public string LDFeeRate(string MerNo, string Fee, int BrandId)
|
|
public string LDFeeRate(string MerNo, string Fee, int BrandId)
|
|
|
{
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置联动机具费率");
|
|
|
|
|
- function.WriteLog(MerNo, "设置联动机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置联动机具费率");
|
|
|
|
|
+ Utils.WriteLog(MerNo, "设置联动机具费率");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
string RequestId = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
string RequestId = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
|
string MercModel = BrandId == 10 ? "DZA" : "DZDA";
|
|
string MercModel = BrandId == 10 ? "DZA" : "DZDA";
|
|
@@ -881,15 +881,15 @@ namespace MySystem
|
|
|
reqdic.Add("mercId", MerNo); // 商户编号
|
|
reqdic.Add("mercId", MerNo); // 商户编号
|
|
|
reqdic.Add("cardType", "01"); // 01 贷记卡 02 扫码
|
|
reqdic.Add("cardType", "01"); // 01 贷记卡 02 扫码
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "设置联动机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(req, "设置联动机具费率");
|
|
|
req = LDEncrypt(req);
|
|
req = LDEncrypt(req);
|
|
|
- function.WriteLog(req, "设置联动机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(req, "设置联动机具费率");
|
|
|
Dictionary<string, object> datadic = new Dictionary<string, object>();
|
|
Dictionary<string, object> datadic = new Dictionary<string, object>();
|
|
|
datadic.Add("encryptedData", req);
|
|
datadic.Add("encryptedData", req);
|
|
|
string data = Newtonsoft.Json.JsonConvert.SerializeObject(datadic);
|
|
string data = Newtonsoft.Json.JsonConvert.SerializeObject(datadic);
|
|
|
- function.WriteLog("请求地址:" + LDRequestUrl + "updateMercRate", "设置联动机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog("请求地址:" + LDRequestUrl + "updateMercRate", "设置联动机具费率");
|
|
|
string result = function.PostWebRequest(LDRequestUrl + "updateMercRate", data, "application/json");
|
|
string result = function.PostWebRequest(LDRequestUrl + "updateMercRate", data, "application/json");
|
|
|
- function.WriteLog(result + "\n\n", "设置联动机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(result + "\n\n", "设置联动机具费率");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -913,8 +913,8 @@ namespace MySystem
|
|
|
|
|
|
|
|
public string BoxServiceFee(string SnList, string ServiceFee)
|
|
public string BoxServiceFee(string SnList, string ServiceFee)
|
|
|
{
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置盒易付机具服务费");
|
|
|
|
|
- function.WriteLog(SnList, "设置盒易付机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置盒易付机具服务费");
|
|
|
|
|
+ Utils.WriteLog(SnList, "设置盒易付机具服务费");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
Dictionary<string, string> headdic = new Dictionary<string, string>();
|
|
Dictionary<string, string> headdic = new Dictionary<string, string>();
|
|
|
string batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
string batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
@@ -939,17 +939,17 @@ namespace MySystem
|
|
|
|
|
|
|
|
headdic.Add("X-Sign", BoxSHA256Sign(timestamp + BoxAppSecret + req));
|
|
headdic.Add("X-Sign", BoxSHA256Sign(timestamp + BoxAppSecret + req));
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "设置盒易付机具服务费");
|
|
|
|
|
- function.WriteLog("请求参数\n" + req, "设置盒易付机具服务费");
|
|
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/inst/register/terms", "设置盒易付机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog("请求头\n" + head, "设置盒易付机具服务费");
|
|
|
|
|
+ Utils.WriteLog("请求参数\n" + req, "设置盒易付机具服务费");
|
|
|
|
|
+ Utils.WriteLog("请求地址:" + BoxRequestUrl + "/inst/register/terms", "设置盒易付机具服务费");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/inst/register/terms", req, headdic);
|
|
string result = PostWebRequest(BoxRequestUrl + "/inst/register/terms", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "设置盒易付机具服务费");
|
|
|
|
|
|
|
+ Utils.WriteLog("返回\n" + result + "\n\n", "设置盒易付机具服务费");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
public string BoxFee(string MerNo, string Fee)
|
|
public string BoxFee(string MerNo, string Fee)
|
|
|
{
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "设置盒易付机具费率");
|
|
|
|
|
- function.WriteLog(MerNo, "设置盒易付机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString(), "设置盒易付机具费率");
|
|
|
|
|
+ Utils.WriteLog(MerNo, "设置盒易付机具费率");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
Dictionary<string, string> headdic = new Dictionary<string, string>();
|
|
Dictionary<string, string> headdic = new Dictionary<string, string>();
|
|
|
string batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
string batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
@@ -969,11 +969,11 @@ namespace MySystem
|
|
|
|
|
|
|
|
headdic.Add("X-Sign", BoxSHA256Sign(timestamp + BoxAppSecret + req));
|
|
headdic.Add("X-Sign", BoxSHA256Sign(timestamp + BoxAppSecret + req));
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "设置盒易付机具费率");
|
|
|
|
|
- function.WriteLog("请求参数\n" + req, "设置盒易付机具费率");
|
|
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/inst/mcht/update_disc", "设置盒易付机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog("请求头\n" + head, "设置盒易付机具费率");
|
|
|
|
|
+ Utils.WriteLog("请求参数\n" + req, "设置盒易付机具费率");
|
|
|
|
|
+ Utils.WriteLog("请求地址:" + BoxRequestUrl + "/inst/mcht/update_disc", "设置盒易付机具费率");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/inst/mcht/update_disc", req, headdic);
|
|
string result = PostWebRequest(BoxRequestUrl + "/inst/mcht/update_disc", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "设置盒易付机具费率");
|
|
|
|
|
|
|
+ Utils.WriteLog("返回\n" + result + "\n\n", "设置盒易付机具费率");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|