|
@@ -23,5 +23,128 @@ namespace MySystem.Controllers
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
+
|
|
|
+ public string test()
|
|
|
+ {
|
|
|
+ testReq("http://idc.pay-api.top/idc-push-api/third/1050056/1560192687980675072/1", "bind_merchant");
|
|
|
+ testReq("http://idc.pay-api.top/idc-push-api/third/1050056/1560192687980675072/8", "un_bind_merchant");
|
|
|
+ testReq("http://idc.pay-api.top/idc-push-api/third/1050056/1560192687980675072/236", "change_bind_merchant");
|
|
|
+ testReq("http://idc.pay-api.top/idc-push-api/third/1050056/1560192687980675072/4", "sim_charge");
|
|
|
+ testReq("http://idc.pay-api.top/idc-push-api/third/1050056/1560192687980675072/3", "service_fee");
|
|
|
+ testReq("http://idc.pay-api.top/idc-push-api/third/1050056/1560192687980675072/2", "trade");
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+
|
|
|
+ public string testReq(string requrl, string reqkind)
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ if(reqkind == "bind_merchant") obj = bind_merchant();
|
|
|
+ if(reqkind == "un_bind_merchant") obj = un_bind_merchant();
|
|
|
+ if(reqkind == "change_bind_merchant") obj = change_bind_merchant();
|
|
|
+ if(reqkind == "sim_charge") obj = sim_charge();
|
|
|
+ if(reqkind == "service_fee") obj = service_fee();
|
|
|
+ if(reqkind == "trade") obj = trade();
|
|
|
+ string content = EncryptHelper.Encrypt1(obj, "57yJ3T1Btz7LytyL");
|
|
|
+ obj = new SortedList<string, string>();
|
|
|
+ obj.Add("type", reqkind);
|
|
|
+ obj.Add("app_id", "KXS000001");
|
|
|
+ obj.Add("notice_id", Guid.NewGuid().ToString());
|
|
|
+ obj.Add("timestamp", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8));
|
|
|
+ obj.Add("content", content);
|
|
|
+ string requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
+ function.WriteLog("请求地址:" + requrl);
|
|
|
+ function.WriteLog("请求参数:" + requestJson);
|
|
|
+ string result = function.PostWebRequest(requrl, requestJson, "application/json");
|
|
|
+ function.WriteLog("返回:" + result);
|
|
|
+ function.WriteLog("\n\n\n");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private SortedList<string, string> bind_merchant()
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("phone", "135****6666");
|
|
|
+ obj.Add("name", "张**");
|
|
|
+ obj.Add("supplement_info", "4307************48");
|
|
|
+ obj.Add("agent_id", "88880019");
|
|
|
+ obj.Add("merch_no", "LKB50009993529999");
|
|
|
+ obj.Add("pos_sn", "LKB1888888");
|
|
|
+ obj.Add("device_model", "N101");
|
|
|
+ obj.Add("term_to", "L4859999");
|
|
|
+ obj.Add("bind_time", "2019-03-12 22:21:50");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+
|
|
|
+ private SortedList<string, string> un_bind_merchant()
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("name", "张**");
|
|
|
+ obj.Add("supplement_info", "4307************48");
|
|
|
+ obj.Add("agent_id", "88880019");
|
|
|
+ obj.Add("merch_no", "LKB50009993529999");
|
|
|
+ obj.Add("pos_sn", "LKB1888888");
|
|
|
+ obj.Add("device_model", "N101");
|
|
|
+ obj.Add("bind_time", "2019-03-12 22:21:50");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+
|
|
|
+ private SortedList<string, string> change_bind_merchant()
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("name", "张**");
|
|
|
+ obj.Add("supplement_info", "4307************48");
|
|
|
+ obj.Add("agent_id", "88880019");
|
|
|
+ obj.Add("merch_no", "LKB50009993529999");
|
|
|
+ obj.Add("before_pos_sn", "LKB1888888");
|
|
|
+ obj.Add("after_pos_sn", "LKB1888888");
|
|
|
+ obj.Add("before_device_model", "N101");
|
|
|
+ obj.Add("after_device_model", "N102");
|
|
|
+ obj.Add("bind_time", "2019-03-12 22:21:50");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+
|
|
|
+ private SortedList<string, string> sim_charge()
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("merch_no", "LKB50009993529999");
|
|
|
+ obj.Add("agent_id", "88880019");
|
|
|
+ obj.Add("pos_sn", "LKB188FBMS78888");
|
|
|
+ obj.Add("amount", "9900");
|
|
|
+ obj.Add("order_id", "2004190320190312222130116680");
|
|
|
+ obj.Add("trans_time", "2019-03-12 22:23:02");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+
|
|
|
+ private SortedList<string, string> service_fee()
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("merch_no", "LKB50009993529999");
|
|
|
+ obj.Add("agent_id", "88880019");
|
|
|
+ obj.Add("pos_sn", "LD188FBMS78888");
|
|
|
+ obj.Add("order_id", "2024190320190312222130116666");
|
|
|
+ obj.Add("amount", "9900");
|
|
|
+ obj.Add("trans_time", "2024-03-12 22:23:02");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+
|
|
|
+ private SortedList<string, string> trade()
|
|
|
+ {
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("agent_id", "88880019");
|
|
|
+ obj.Add("order_id", "2024010420191016203820115800");
|
|
|
+ obj.Add("trans_id", "2024010420191016203820115800");
|
|
|
+ obj.Add("merch_no", "LKB50009993529999");
|
|
|
+ obj.Add("term_no", "M4859999");
|
|
|
+ obj.Add("pos_sn", "LD188FBMS78888");
|
|
|
+ obj.Add("amount", "000000099910");
|
|
|
+ obj.Add("trans_time", "20190312222421");
|
|
|
+ obj.Add("ret_code", "00");
|
|
|
+ obj.Add("ret_msg", "交易成功");
|
|
|
+ obj.Add("fee_amount", "4499");
|
|
|
+ obj.Add("pay_type", "0");
|
|
|
+ obj.Add("card_type", "C");
|
|
|
+ obj.Add("trans_type", "31");
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
}
|
|
|
}
|