|
@@ -44,17 +44,17 @@ namespace MySystem
|
|
|
public string AddNewMerchant(AddNewMerchant request)
|
|
|
{
|
|
|
request.brh = BrhCode;
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒新创建商户");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒新创建商户");
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
|
|
|
- function.WriteLog(req, "好哒新创建商户");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒新创建商户");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒新创建商户");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒新创建商户");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/new_create_mcht", "好哒新创建商户");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒新创建商户");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒新创建商户");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/new_create_mcht", "好哒新创建商户");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/inst/mcht/new_create_mcht", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒新创建商户");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒新创建商户");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -67,20 +67,20 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryMerchantStatus(string instId, string mchtNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒查询商户审核状态");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询商户审核状态");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("instId", instId);
|
|
|
reqdic.Add("mchtNo", mchtNo);
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒查询商户审核状态");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒查询商户审核状态");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒查询商户审核状态");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒查询商户审核状态");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/query_mcht_audit", "好哒查询商户审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询商户审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询商户审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/query_mcht_audit", "好哒查询商户审核状态");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/inst/mcht/query_mcht_audit", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒查询商户审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒查询商户审核状态");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -93,19 +93,19 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryAuthStatus(string mchtNo, string storeNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒查询实名认证状态");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询实名认证状态");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
|
|
|
reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒查询实名认证状态");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒查询实名认证状态");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒查询实名认证状态");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒查询实名认证状态");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/wechat/queryVerifiedResult.json", "好哒查询实名认证状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询实名认证状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询实名认证状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/wechat/queryVerifiedResult.json", "好哒查询实名认证状态");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/wechat/queryVerifiedResult.json", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒查询实名认证状态");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒查询实名认证状态");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -118,19 +118,19 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryAuthQRcode(string mchtNo, string storeNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒查询实名认证二维码");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询实名认证二维码");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
|
|
|
reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒查询实名认证二维码");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒查询实名认证二维码");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒查询实名认证二维码");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒查询实名认证二维码");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/wechat/queryVerifiedQrcode.json", "好哒查询实名认证二维码");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询实名认证二维码");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询实名认证二维码");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/wechat/queryVerifiedQrcode.json", "好哒查询实名认证二维码");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/wechat/queryVerifiedQrcode.json", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒查询实名认证二维码");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒查询实名认证二维码");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -151,7 +151,7 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string WeChatPay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode, string subAppId, string subAppIdType, string ledgerModel)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒微信公众号和小程序支付");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒微信公众号和小程序支付");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo); //盒子的商户编号
|
|
|
reqdic.Add("storeNo", storeNo); //盒子的门店编码
|
|
@@ -165,14 +165,14 @@ namespace MySystem
|
|
|
reqdic.Add("ledgerModel", ledgerModel); //分账类型:1不分账 2分账,注意只有开通了分账才能传这个字段
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒微信公众号和小程序支付");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒微信公众号和小程序支付");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒微信公众号和小程序支付");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒微信公众号和小程序支付");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", "好哒微信公众号和小程序支付");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒微信公众号和小程序支付");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒微信公众号和小程序支付");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", "好哒微信公众号和小程序支付");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒微信公众号和小程序支付");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒微信公众号和小程序支付");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -190,7 +190,7 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string Alipay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒支付宝服务窗支付");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒支付宝服务窗支付");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo); //盒子的商户编号
|
|
|
reqdic.Add("storeNo", storeNo); //盒子的门店编码
|
|
@@ -201,14 +201,14 @@ namespace MySystem
|
|
|
reqdic.Add("confirmCode", confirmCode); //支付确认码,由4位纯数字组成,每次请求时随机生成
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒支付宝服务窗支付");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒支付宝服务窗支付");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒支付宝服务窗支付");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒支付宝服务窗支付");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", "好哒支付宝服务窗支付");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒支付宝服务窗支付");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒支付宝服务窗支付");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", "好哒支付宝服务窗支付");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒支付宝服务窗支付");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒支付宝服务窗支付");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -224,7 +224,7 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string AggregatedPayRefund(string mchtNo, string storeNo, string outRefundNo, string outOrderNo, string refundAmount)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒聚合支付退款");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("mchtNo", mchtNo); // 盒子的商户编号
|
|
@@ -234,14 +234,14 @@ namespace MySystem
|
|
|
reqdic.Add("refundAmount", refundAmount); //10 退款金额,单位:分
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒聚合支付退款");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒聚合支付退款");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒聚合支付退款");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/refund", "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/refund", "好哒聚合支付退款");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/unitedtrade/refund", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒聚合支付退款");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -254,21 +254,21 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string OpenDivideAccounts(string mchtNo, string storeNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒开通分账");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒开通分账");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
|
|
|
reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒开通分账");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒开通分账");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒开通分账");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒开通分账");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/mcht/reg", "好哒开通分账");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒开通分账");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒开通分账");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/mcht/reg", "好哒开通分账");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/mcht/reg", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒开通分账");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒开通分账");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -282,20 +282,20 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string DivideAccountsSign(string acctNo, string mchtNo, string storeNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒分账接收方签约");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒分账接收方签约");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("acctNo", acctNo); // 账户号
|
|
|
reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
|
|
|
reqdic.Add("storeNo", storeNo); // 慧掌柜门店号
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒分账接收方签约");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒分账接收方签约");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒分账接收方签约");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒分账接收方签约");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/acct/bind_mcht", "好哒分账接收方签约");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒分账接收方签约");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒分账接收方签约");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/acct/bind_mcht", "好哒分账接收方签约");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/acct/bind_mcht", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒分账接收方签约");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒分账接收方签约");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -307,17 +307,17 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string AddOpenDivideAccounts(AddOpenDivideAccounts request)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒添加分账接收方账户");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒添加分账接收方账户");
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
|
|
|
- function.WriteLog(req, "好哒添加分账接收方账户");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒添加分账接收方账户");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒添加分账接收方账户");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒添加分账接收方账户");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/acct/register", "好哒添加分账接收方账户");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒添加分账接收方账户");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒添加分账接收方账户");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/acct/register", "好哒添加分账接收方账户");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/acct/register", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒添加分账接收方账户");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒添加分账接收方账户");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -330,19 +330,19 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryOrderDivideAccounts(string mchtNo, string orderNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒分账交易详情查询");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
|
|
|
reqdic.Add("orderNo", orderNo); // 交易订单号
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒分账交易详情查询");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒分账交易详情查询");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒分账交易详情查询");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/acct/bind_mcht", "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/acct/bind_mcht", "好哒分账交易详情查询");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/acct/bind_mcht", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒分账交易详情查询");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -355,17 +355,17 @@ namespace MySystem
|
|
|
///
|
|
|
public string OrderDivideAccounts(OrderDivideAccounts request)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒订单分账申请");
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
|
|
|
- function.WriteLog(req, "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒订单分账申请");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒订单分账申请");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒订单分账申请");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/order/apply", "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/order/apply", "好哒订单分账申请");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/order/apply", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒订单分账申请");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -378,19 +378,19 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string OrderDivideAccountsQuery(string applyNo, string mchtNo)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒订单分账结果查询");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒订单分账结果查询");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("applyNo", applyNo); // 账户号
|
|
|
reqdic.Add("mchtNo", mchtNo); // 慧掌柜商户号
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒订单分账结果查询");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒订单分账结果查询");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒订单分账结果查询");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒订单分账结果查询");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/apply/query", "好哒订单分账结果查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒订单分账结果查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒订单分账结果查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/apply/query", "好哒订单分账结果查询");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/apply/query", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒订单分账结果查询");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒订单分账结果查询");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -402,17 +402,17 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
// public string ChangeMerchantCard(ChangeMerchantCard request)
|
|
|
// {
|
|
|
- // function.WriteLog(DateTime.Now.ToString(), "好哒商户修改银行卡");
|
|
|
+ // LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒商户修改银行卡");
|
|
|
|
|
|
// string req = Newtonsoft.Json.JsonConvert.SerializeObject(request);
|
|
|
- // function.WriteLog(req, "好哒商户修改银行卡");
|
|
|
+ // LogHelper.Instance.WriteLog(req, "好哒商户修改银行卡");
|
|
|
// Dictionary<string, string> headdic = GetHeader(req);
|
|
|
// string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- // function.WriteLog("请求头\n" + head, "好哒商户修改银行卡");
|
|
|
- // function.WriteLog("请求参数\n" + req, "好哒商户修改银行卡");
|
|
|
- // function.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/update_acct", "好哒商户修改银行卡");
|
|
|
+ // LogHelper.Instance.WriteLog("请求头\n" + head, "好哒商户修改银行卡");
|
|
|
+ // LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒商户修改银行卡");
|
|
|
+ // LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/update_acct", "好哒商户修改银行卡");
|
|
|
// string result = PostWebRequest(BoxRequestUrl + "/api/inst/mcht/update_acct", req, headdic);
|
|
|
- // function.WriteLog("返回\n" + result + "\n\n", "好哒商户修改银行卡");
|
|
|
+ // LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒商户修改银行卡");
|
|
|
|
|
|
// return result;
|
|
|
// }
|
|
@@ -425,20 +425,20 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryChangeCardStatus(string mchtNo, string taskId)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒查询修改银行卡任务审核状态");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒查询修改银行卡任务审核状态");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo);
|
|
|
reqdic.Add("taskId", taskId);
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒查询修改银行卡任务审核状态");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒查询修改银行卡任务审核状态");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒查询修改银行卡任务审核状态");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒查询修改银行卡任务审核状态");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/query_acct_task", "好哒查询修改银行卡任务审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒查询修改银行卡任务审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒查询修改银行卡任务审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/inst/mcht/query_acct_task", "好哒查询修改银行卡任务审核状态");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/inst/mcht/query_acct_task", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒查询修改银行卡任务审核状态");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒查询修改银行卡任务审核状态");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -453,7 +453,7 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string BindWeChatAppId(string mchtNo, string storeNo, string subAppId)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒绑定微信appid接口");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒绑定微信appid接口");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("mchtNo", mchtNo); // 盒子商户号
|
|
@@ -461,14 +461,14 @@ namespace MySystem
|
|
|
reqdic.Add("subAppId", subAppId); // 公众号appid或者小程序appid
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒绑定微信appid接口");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒绑定微信appid接口");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒绑定微信appid接口");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒绑定微信appid接口");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/wechat/add_sub_config", "好哒绑定微信appid接口");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒绑定微信appid接口");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒绑定微信appid接口");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/wechat/add_sub_config", "好哒绑定微信appid接口");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/wechat/add_sub_config", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒绑定微信appid接口");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒绑定微信appid接口");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -487,7 +487,7 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryAccountList(string mchtNo, string startTime, string endTime, string tradeMchtNo, string cardNo, string settleStatus, string page = "1", string rows = "10")
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒到账记录查询");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒到账记录查询");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("mchtNo", mchtNo); // 盒子商户号
|
|
@@ -500,14 +500,14 @@ namespace MySystem
|
|
|
reqdic.Add("rows", rows); // 每页大小,默认10,最大500
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒到账记录查询");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒到账记录查询");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒到账记录查询");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒到账记录查询");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/accb/to_account/query", "好哒到账记录查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒到账记录查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒到账记录查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/accb/to_account/query", "好哒到账记录查询");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/accb/to_account/query", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒到账记录查询");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒到账记录查询");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -520,21 +520,21 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryAccountDetail(string mchtNo, string id)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒到账记录详情");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒到账记录详情");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("mchtNo", mchtNo); // 商户号
|
|
|
reqdic.Add("id", id); // id
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒到账记录详情");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒到账记录详情");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒到账记录详情");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒到账记录详情");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/accb/to_account/get", "好哒到账记录详情");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒到账记录详情");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒到账记录详情");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/accb/to_account/get", "好哒到账记录详情");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/accb/to_account/get", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒到账记录详情");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒到账记录详情");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -547,7 +547,7 @@ namespace MySystem
|
|
|
///
|
|
|
public string OrderDivideAccounts22()
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒订单分账申请");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
|
|
|
Dictionary<string, object> lists = new Dictionary<string, object>();
|
|
@@ -568,14 +568,14 @@ namespace MySystem
|
|
|
|
|
|
reqdic.Add("detail", list);
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒订单分账申请");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒订单分账申请");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒订单分账申请");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/order/apply", "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/order/apply", "好哒订单分账申请");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/order/apply", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒订单分账申请");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒订单分账申请");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -588,19 +588,19 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string QueryOrderDivideAccountsss()
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒分账交易详情查询");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", "1475762"); // 慧掌柜商户号
|
|
|
reqdic.Add("orderNo", "G2230907C01986946066"); // 交易订单号
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒分账交易详情查询");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒分账交易详情查询");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒分账交易详情查询");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/trade/clear/get", "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/v3/hzg/part/trade/clear/get", "好哒分账交易详情查询");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/v3/hzg/part/trade/clear/get", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒分账交易详情查询");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒分账交易详情查询");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -616,7 +616,7 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string AggregatedPayRefundsss()
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒聚合支付退款");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("mchtNo", "1475762"); // 盒子的商户编号
|
|
@@ -627,14 +627,14 @@ namespace MySystem
|
|
|
reqdic.Add("refundReason", "门店分红"); //退款原因(仅微信交易且退款金额大于1元时在退款消息中展示)
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒聚合支付退款");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒聚合支付退款");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒聚合支付退款");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/refund", "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/refund", "好哒聚合支付退款");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/unitedtrade/refund", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒聚合支付退款");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒聚合支付退款");
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -700,9 +700,9 @@ namespace MySystem
|
|
|
string ret = string.Empty;
|
|
|
try
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "请求好哒API日志");
|
|
|
- function.WriteLog(postUrl, "请求好哒API日志");
|
|
|
- function.WriteLog(paramData, "请求好哒API日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "请求好哒API日志");
|
|
|
+ LogHelper.Instance.WriteLog(postUrl, "请求好哒API日志");
|
|
|
+ LogHelper.Instance.WriteLog(paramData, "请求好哒API日志");
|
|
|
byte[] postData = System.Text.Encoding.UTF8.GetBytes(paramData);
|
|
|
// 设置提交的相关参数
|
|
|
System.Net.HttpWebRequest request = System.Net.WebRequest.Create(postUrl) as System.Net.HttpWebRequest;
|
|
@@ -733,7 +733,7 @@ namespace MySystem
|
|
|
srcString = reader.ReadToEnd();
|
|
|
ret = srcString; //返回值赋值
|
|
|
reader.Close();
|
|
|
- function.WriteLog(srcString, "请求好哒API日志");
|
|
|
+ LogHelper.Instance.WriteLog(srcString, "请求好哒API日志");
|
|
|
}
|
|
|
catch (System.Net.WebException ex)
|
|
|
{
|
|
@@ -747,7 +747,7 @@ namespace MySystem
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ret = "fail";
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求好哒API异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求好哒API异常");
|
|
|
}
|
|
|
return ret;
|
|
|
}
|
|
@@ -760,21 +760,21 @@ namespace MySystem
|
|
|
/// <returns></returns>
|
|
|
public string GetToken(string fileName, string action)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "好哒获取文件令牌接口");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "好哒获取文件令牌接口");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
|
|
|
reqdic.Add("fileName", fileName); // 文件名
|
|
|
reqdic.Add("action", action); // 操作类型 0 上传图片
|
|
|
|
|
|
string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
|
|
|
- function.WriteLog(req, "好哒获取文件令牌接口");
|
|
|
+ LogHelper.Instance.WriteLog(req, "好哒获取文件令牌接口");
|
|
|
Dictionary<string, string> headdic = GetHeader(req);
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
- function.WriteLog("请求头\n" + head, "好哒获取文件令牌接口");
|
|
|
- function.WriteLog("请求参数\n" + req, "好哒获取文件令牌接口");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/api/auth/v1/get_file_token", "好哒获取文件令牌接口");
|
|
|
+ LogHelper.Instance.WriteLog("请求头\n" + head, "好哒获取文件令牌接口");
|
|
|
+ LogHelper.Instance.WriteLog("请求参数\n" + req, "好哒获取文件令牌接口");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + BoxRequestUrl + "/api/auth/v1/get_file_token", "好哒获取文件令牌接口");
|
|
|
string result = PostWebRequest(BoxRequestUrl + "/api/auth/v1/get_file_token", req, headdic);
|
|
|
- function.WriteLog("返回\n" + result + "\n\n", "好哒获取文件令牌接口");
|
|
|
+ LogHelper.Instance.WriteLog("返回\n" + result + "\n\n", "好哒获取文件令牌接口");
|
|
|
|
|
|
return result;
|
|
|
}
|