|
|
@@ -54,7 +54,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "接口创建应用事务异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "接口创建应用事务异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -120,7 +120,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "代签约产品通用接口异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "代签约产品通用接口异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -142,7 +142,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "接口创建应用事务异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "接口创建应用事务异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -166,7 +166,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "查询签约申请的结果异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "查询签约申请的结果异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -192,7 +192,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "支付宝统一收单交易创建(获取authtoken)异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "支付宝统一收单交易创建(获取authtoken)异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -230,11 +230,11 @@ namespace MySystem
|
|
|
{
|
|
|
AlipayTradeCreateResponse response = client.Execute(request, null, MerToken);
|
|
|
result = response.Body;
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + Contentjson + "\n" + result, "支付宝统一收单交易创建");
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString() + "\n" + Contentjson + "\n" + result, "支付宝统一收单交易创建");
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "支付宝统一收单交易创建异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "支付宝统一收单交易创建异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -255,7 +255,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "统一收单线下交易查询异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "统一收单线下交易查询异常");
|
|
|
result = "";
|
|
|
}
|
|
|
return result;
|
|
|
@@ -294,7 +294,7 @@ namespace MySystem
|
|
|
requestAccess_token.GrantType = "authorization_code";
|
|
|
requestAccess_token.Code = Auth_code;
|
|
|
AlipaySystemOauthTokenResponse responseAccess_token = client.Execute(requestAccess_token);
|
|
|
- function.WriteLog(responseAccess_token.Body, "支付宝授权");
|
|
|
+ Utils.WriteLog(responseAccess_token.Body, "支付宝授权");
|
|
|
string AlipayUserId = responseAccess_token.AlipayUserId; //20881043611849171819285350010300
|
|
|
string UserId = responseAccess_token.UserId; //2088222145274001
|
|
|
result = UserId + "|" + AlipayUserId;
|
|
|
@@ -303,7 +303,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "支付宝授权报错日志");
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "支付宝授权报错日志");
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
@@ -311,7 +311,7 @@ namespace MySystem
|
|
|
|
|
|
public string GetAlipayMobile(string response)
|
|
|
{
|
|
|
- function.WriteLog(response, "解密报文");
|
|
|
+ Utils.WriteLog(response, "解密报文");
|
|
|
//1. 获取验签和解密所需要的参数
|
|
|
IDictionary openapiResult = Jayrock.Json.Conversion.JsonConvert.Import(response) as IDictionary;
|
|
|
string signType;
|
|
|
@@ -354,7 +354,7 @@ namespace MySystem
|
|
|
string result = "";
|
|
|
try
|
|
|
{
|
|
|
- function.WriteLog(content, "解密报文");
|
|
|
+ Utils.WriteLog(content, "解密报文");
|
|
|
result = AlipayEncrypt.AesDencrypt(Key, content, charset);
|
|
|
JsonData obj = JsonMapper.ToObject(result);
|
|
|
if (obj["code"].ToString() == "10000")
|
|
|
@@ -366,7 +366,7 @@ namespace MySystem
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
//解密异常, 记录日志
|
|
|
- function.WriteLog(ex.ToString(), "获取手机号解密异常");
|
|
|
+ Utils.WriteLog(ex.ToString(), "获取手机号解密异常");
|
|
|
}
|
|
|
return result;
|
|
|
// 如果是加密的报文则需要在密文的前后添加双引号
|
|
|
@@ -440,7 +440,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "支付宝小程序提审异常");
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "支付宝小程序提审异常");
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
@@ -465,7 +465,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "查询小程序版本状态和详情异常");
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "查询小程序版本状态和详情异常");
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
@@ -489,7 +489,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "小程序退回开发状态异常");
|
|
|
+ Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "小程序退回开发状态异常");
|
|
|
}
|
|
|
return result;
|
|
|
}
|