|
@@ -1294,19 +1294,46 @@ namespace MySystem
|
|
|
|
|
|
public string LDZZBFeeRate(string MerNo, decimal AddRate, decimal Fee = 0)
|
|
|
{
|
|
|
+ string s = LDZZBFeeRateQuery(MerNo);
|
|
|
+ JsonData jsonObj = JsonMapper.ToObject(s);
|
|
|
+ string aesKey = jsonObj["encryptKey"].ToString();
|
|
|
+ aesKey = LDZZBDecrypt(aesKey);
|
|
|
+ string content = AesDecrypt(jsonObj["data"].ToString(), aesKey);
|
|
|
+ JsonData contentObj = JsonMapper.ToObject(content);
|
|
|
+
|
|
|
Dictionary<string, object> req = new Dictionary<string, object>();
|
|
|
req.Add("customerNo", MerNo);
|
|
|
List<Dictionary<string, object>> customerRateList = new List<Dictionary<string, object>>();
|
|
|
- Dictionary<string, object> customerRateItem = new Dictionary<string, object>();
|
|
|
- customerRateItem.Add("payTypeViewCode", "POS_CC");
|
|
|
- customerRateItem.Add("rateValue", AddRate);
|
|
|
- customerRateItem.Add("fixedValue", Fee);
|
|
|
- customerRateItem.Add("cappingValue", 0);
|
|
|
- customerRateList.Add(customerRateItem);
|
|
|
+ for (int i = 0; i < contentObj.Count; i++)
|
|
|
+ {
|
|
|
+ JsonData item = contentObj[i];
|
|
|
+ string payTypeViewCode = item["payTypeViewCode"].ToString();
|
|
|
+ decimal rateValue = decimal.Parse(item["rateValue"].ToString());
|
|
|
+ decimal fixedValue = decimal.Parse(item["fixedValue"].ToString());
|
|
|
+ if(payTypeViewCode == "POS_CC")
|
|
|
+ {
|
|
|
+ rateValue = AddRate;
|
|
|
+ fixedValue = Fee;
|
|
|
+ }
|
|
|
+ Dictionary<string, object> customerRateItem = new Dictionary<string, object>();
|
|
|
+ customerRateItem.Add("payTypeViewCode", payTypeViewCode);
|
|
|
+ customerRateItem.Add("rateValue", rateValue);
|
|
|
+ customerRateItem.Add("fixedValue", fixedValue);
|
|
|
+ customerRateItem.Add("cappingValue", decimal.Parse(item["cappingValue"].ToString()));
|
|
|
+ customerRateList.Add(customerRateItem);
|
|
|
+ }
|
|
|
+
|
|
|
req.Add("customerRateList", customerRateList);
|
|
|
return LDZZBPost(req, "customerRateModify");
|
|
|
}
|
|
|
|
|
|
+ public string LDZZBFeeRateQuery(string MerNo)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> req = new Dictionary<string, object>();
|
|
|
+ req.Add("customerNo", MerNo);
|
|
|
+ return LDZZBPost(req, "customerRateQuery");
|
|
|
+ }
|
|
|
+
|
|
|
public string LDZZBPost(Dictionary<string, object> req, string path)
|
|
|
{
|
|
|
string logString = "";
|