|
@@ -1173,31 +1173,58 @@ namespace MySystem
|
|
|
function.WriteLog("返回报文\n" + result + "\n\n\n", "来客吧L吧设置服务费");
|
|
|
return result;
|
|
|
}
|
|
|
- // public string LkbSetFee(string sn, decimal fee = 0.6M)
|
|
|
- // {
|
|
|
- // List<SetDepositList> rateDOs = new List<SetDepositList>();
|
|
|
- // rateDOs.Add(new SetDepositList()
|
|
|
- // {
|
|
|
- // productSubType = "2020032007vz7Ux6",
|
|
|
- // updateValue = fee,
|
|
|
- // updateType = 0
|
|
|
- // });
|
|
|
- // Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
|
- // headers.Add("X-Client-ID", lkbClientId);
|
|
|
- // headers.Add("X-Security", "RSA");
|
|
|
- // Dictionary<string, object> obj = new Dictionary<string, object>();
|
|
|
- // obj.Add("factorySequenceNo", sn);
|
|
|
- // obj.Add("productCode", 2);
|
|
|
- // obj.Add("productName", 2);
|
|
|
- // obj.Add("rateDOs", rateDOs);
|
|
|
- // string content = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
- // content = LkbEncrypt2(content);
|
|
|
- // string signstr = LkbSign(content);
|
|
|
- // headers.Add("X-Sign", signstr);
|
|
|
- // string req = "{\"param\":\"" + content + "\"}";
|
|
|
- // string result = function.PostWebRequest(lkbReqUrl2, req, headers, "application/json");
|
|
|
- // return result;
|
|
|
- // }
|
|
|
+ public string LkbSetFee(string sn, decimal rate = 0.6M, int fee = 0)
|
|
|
+ {
|
|
|
+ List<Dictionary<string, string>> innerParamList = new List<Dictionary<string, string>>();
|
|
|
+ Dictionary<string, string> item = new Dictionary<string, string>();
|
|
|
+ item.Add("rateNo", "R1012");
|
|
|
+ item.Add("rateName", "刷卡交易手续费");
|
|
|
+ item.Add("rateValue", rate.ToString("f2"));
|
|
|
+ innerParamList.Add(item);
|
|
|
+ item = new Dictionary<string, string>();
|
|
|
+ item.Add("rateNo", "R1013");
|
|
|
+ item.Add("rateName", "刷卡结算手续费");
|
|
|
+ item.Add("rateValue", fee.ToString());
|
|
|
+ innerParamList.Add(item);
|
|
|
+ item = new Dictionary<string, string>();
|
|
|
+ item.Add("rateNo", "R1014");
|
|
|
+ item.Add("rateName", "扫码交易手续费");
|
|
|
+ item.Add("rateValue", "0.38");
|
|
|
+ innerParamList.Add(item);
|
|
|
+ item = new Dictionary<string, string>();
|
|
|
+ item.Add("rateNo", "R1015");
|
|
|
+ item.Add("rateName", "扫码结算手续费");
|
|
|
+ item.Add("rateValue", "0");
|
|
|
+ innerParamList.Add(item);
|
|
|
+ item = new Dictionary<string, string>();
|
|
|
+ item.Add("rateNo", "R1016");
|
|
|
+ item.Add("rateName", "借记卡封顶手续费");
|
|
|
+ item.Add("rateValue", "2500");
|
|
|
+ innerParamList.Add(item);
|
|
|
+ Dictionary<string, string> headers = new Dictionary<string, string>();
|
|
|
+ headers.Add("X-Client", lkbClientId);
|
|
|
+ headers.Add("X-Security", "RSA");
|
|
|
+ DateTimeOffset currentTime = DateTimeOffset.UtcNow;
|
|
|
+ string rfc1123FormattedTime = currentTime.ToString("r");
|
|
|
+ headers.Add("X-Time", rfc1123FormattedTime);
|
|
|
+ headers.Add("X-Trace", function.get_Random(32));
|
|
|
+ function.WriteLog("请求地址\n" + lkbReqUrl2, "来客吧L吧设置费率");
|
|
|
+ Dictionary<string, object> obj = new Dictionary<string, object>();
|
|
|
+ obj.Add("factorySequenceNo", sn);
|
|
|
+ obj.Add("productCode", "100");
|
|
|
+ obj.Add("productName", "来客吧");
|
|
|
+ obj.Add("innerParamList", innerParamList);
|
|
|
+ string content = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
+ function.WriteLog("明文参数\n" + content, "来客吧L吧设置费率");
|
|
|
+ content = LkbEncrypt2(content);
|
|
|
+ string signstr = LkbSign(content);
|
|
|
+ headers.Add("X-Sign", signstr);
|
|
|
+ string req = "{\"param\":\"" + content + "\"}";
|
|
|
+ function.WriteLog("加密参数\n" + req, "来客吧L吧设置费率");
|
|
|
+ string result = function.PostWebRequest(lkbReqUrl2, req, headers, "application/json");
|
|
|
+ function.WriteLog("返回报文\n" + result + "\n\n\n", "来客吧L吧设置费率");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
public string LkbEncrypt(string data)
|
|
|
{
|
|
|
return new RSAHelper(RSAType.RSA, System.Text.Encoding.UTF8, "", lkbMfe88PublicKey).Encrypt(data);
|