Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
8c4f2475
Commit
8c4f2475
authored
Aug 26, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b717c3a4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
286 deletions
+35
-286
ResponseHandler.cs
Mall.Common/Pay/WeChatPat/ResponseHandler.cs
+2
-3
MiniProgramMsgModule.cs
Mall.Module.User/MiniProgramMsgModule.cs
+28
-176
PayUtil.cs
Mall.WebApi/App_Code/PayUtil.cs
+4
-106
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+1
-1
No files found.
Mall.Common/Pay/WeChatPat/ResponseHandler.cs
View file @
8c4f2475
...
@@ -60,7 +60,7 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -60,7 +60,7 @@ namespace Mall.Common.Pay.WeChatPat
s
.
Flush
();
s
.
Flush
();
s
.
Close
();
s
.
Close
();
s
.
Dispose
();
s
.
Dispose
();
Plugin
.
LogHelper
.
Write
(
$"GetNotifyData Receive data from WeChat :
{
builder
.
ToString
()}
"
);
Plugin
.
LogHelper
.
Write
Info
(
$"GetNotifyData Receive data from WeChat :
{
builder
.
ToString
()}
"
);
//转换数据格式并验证签名
//转换数据格式并验证签名
// WxPayData data = new WxPayData();
// WxPayData data = new WxPayData();
...
@@ -81,8 +81,7 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -81,8 +81,7 @@ namespace Mall.Common.Pay.WeChatPat
//若签名错误,则立即返回结果给微信支付后台
//若签名错误,则立即返回结果给微信支付后台
Plugin
.
LogHelper
.
Error
(
$"ResponseHandler xml错误"
,
ex
);
Plugin
.
LogHelper
.
Error
(
$"ResponseHandler xml错误"
,
ex
);
}
}
Plugin
.
LogHelper
.
Write
(
$"GetNotifyData Check sign success"
);
Plugin
.
LogHelper
.
WriteInfo
(
$"GetNotifyData Check sign success"
);
}
}
/// <summary>
/// <summary>
...
...
Mall.Module.User/MiniProgramMsgModule.cs
View file @
8c4f2475
This diff is collapsed.
Click to expand it.
Mall.WebApi/App_Code/PayUtil.cs
View file @
8c4f2475
...
@@ -77,7 +77,7 @@ namespace Mall.WebApi.App_Code
...
@@ -77,7 +77,7 @@ namespace Mall.WebApi.App_Code
});
});
var
xe
=
XElement
.
Parse
(
result
,
LoadOptions
.
SetLineInfo
);
var
xe
=
XElement
.
Parse
(
result
,
LoadOptions
.
SetLineInfo
);
LogHelper
.
Write
(
null
,
"订单号【"
+
sOrderNo
+
"】成功回调:"
+
xe
);
LogHelper
.
Write
Info
(
"订单号【"
+
sOrderNo
+
"】成功回调:"
+
xe
);
try
try
{
{
//存入缓存,方便自动取消的时候不被清理
//存入缓存,方便自动取消的时候不被清理
...
@@ -122,7 +122,7 @@ namespace Mall.WebApi.App_Code
...
@@ -122,7 +122,7 @@ namespace Mall.WebApi.App_Code
var
res
=
new
ResponseHandler
(
accessor
);
var
res
=
new
ResponseHandler
(
accessor
);
var
tradeType
=
res
.
GetParameter
(
"trade_type"
);
var
tradeType
=
res
.
GetParameter
(
"trade_type"
);
LogHelper
.
Write
(
null
,
"Notify支付回调:res-"
+
res
.
ToString
());
LogHelper
.
Write
Info
(
"Notify支付回调:res-"
+
res
.
ToString
());
RB_MiniProgram_Extend
model
=
new
RB_MiniProgram_Extend
();
RB_MiniProgram_Extend
model
=
new
RB_MiniProgram_Extend
();
model
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
{
MallBaseId
=
0
,
TenantId
=
0
});
model
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
{
MallBaseId
=
0
,
TenantId
=
0
});
res
.
SetKey
(
model
.
WeChatApiSecret
);
res
.
SetKey
(
model
.
WeChatApiSecret
);
...
@@ -181,7 +181,7 @@ namespace Mall.WebApi.App_Code
...
@@ -181,7 +181,7 @@ namespace Mall.WebApi.App_Code
}
}
else
else
{
{
LogHelper
.
Write
(
null
,
"Notify支付回调:returnMsg-"
+
returnMsg
);
LogHelper
.
Write
Info
(
"Notify支付回调:returnMsg-"
+
returnMsg
);
}
}
}
}
else
else
...
@@ -197,109 +197,7 @@ namespace Mall.WebApi.App_Code
...
@@ -197,109 +197,7 @@ namespace Mall.WebApi.App_Code
}
}
/// <summary>
//public ProcessNotify(HttpContext context)
//{
// WxPayData notifyData = GetNotifyData(context);
// //检查支付结果中transaction_id是否存在
// if (!notifyData.IsSet("transaction_id"))
// {
// //若transaction_id不存在,则立即返回结果给微信支付后台
// WxPayData res = new WxPayData();
// res.SetValue("return_code", "FAIL");
// res.SetValue("return_msg", "支付结果中微信订单号不存在");
// context.Response.WriteAsync(res.ToXml());
// return (false, null);
// }
// string transaction_id = notifyData.GetValue("transaction_id").ToString();
// string out_trade_no = notifyData.GetValue("out_trade_no").ToString();
// //查询订单,判断订单真实性
// if (!QueryOrder(transaction_id))
// {
// //若订单查询失败,则立即返回结果给微信支付后台
// WxPayData res = new WxPayData();
// res.SetValue("return_code", "FAIL");
// res.SetValue("return_msg", "订单查询失败");
// context.Response.WriteAsync(res.ToXml());
// return (false, null);
// }
// //查询订单成功
// else
// {
// WxPayData res = new WxPayData();
// res.SetValue("return_code", "SUCCESS");
// res.SetValue("return_msg", "OK");
// context.Response.WriteAsync(res.ToXml());
// ProcessNotifyReturn notifyReturn = new ProcessNotifyReturn
// {
// out_trade_no = out_trade_no,
// transaction_id = transaction_id
// };
// return (true, notifyReturn);
// }
//}
///// <summary>
///// 接收从微信支付后台发送过来的数据并验证签名
///// </summary>
///// <returns>微信支付后台返回的数据</returns>
//public WxPayData GetNotifyData(HttpContext context)
//{
// #region
// //注意:如果用以下读取流的方法,.net core 3.0 以后一定要加下边那段
// //.net core 3.0以后需加下边这段,否则Stream会报错
// var syncIOFeature = context.Features.Get<IHttpBodyControlFeature>();
// if (syncIOFeature != null)
// {
// syncIOFeature.AllowSynchronousIO = true;
// }
// #endregion
// //接收从微信后台POST过来的数据
// System.IO.Stream s = context.Request.Body;
// int count = 0;
// byte[] buffer = new byte[1024];
// StringBuilder builder = new StringBuilder();
// while ((count = s.Read(buffer, 0, 1024)) > 0)
// {
// builder.Append(Encoding.UTF8.GetString(buffer, 0, count));
// }
// s.Flush();
// s.Close();
// s.Dispose();
// LogHelper.Write($"GetNotifyData Receive data from WeChat :{builder.ToString()}");
// //转换数据格式并验证签名
// WxPayData data = new WxPayData();
// try
// {
// data.FromXml(builder.ToString());
// }
// catch (Exception ex)
// {
// //若签名错误,则立即返回结果给微信支付后台
// WxPayData res = new WxPayData();
// res.SetValue("return_code", "FAIL");
// res.SetValue("return_msg", ex.Message);
// context.Response.WriteAsync(res.ToXml());
// }
// LogHelper.Write($"GetNotifyData Check sign success");
// return data;
//}
// <summary>
/// 退款 传入订单号OrderNumber,RefundNumber,总金额total_fee(分),RefundFee退款金额(分),
/// 退款 传入订单号OrderNumber,RefundNumber,总金额total_fee(分),RefundFee退款金额(分),
/// </summary>
/// </summary>
/// <param name="param"></param>
/// <param name="param"></param>
...
...
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
8c4f2475
...
@@ -72,7 +72,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -72,7 +72,7 @@ namespace Mall.WebApi.Controllers.User
//验证是否新用户
//验证是否新用户
if
(!
userModule
.
ValidateUserOpenId
(
demodel
.
OpenId
,
demodel
.
Source
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
))
if
(!
userModule
.
ValidateUserOpenId
(
demodel
.
OpenId
,
demodel
.
Source
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
))
{
{
LogHelper
.
Write
(
demodel
.
OpenId
+
",SuperiorId:"
+
(
demodel
.
SuperiorId
??
0
));
LogHelper
.
Write
Info
(
demodel
.
OpenId
+
",SuperiorId:"
+
(
demodel
.
SuperiorId
??
0
));
//注册新用户
//注册新用户
if
(
string
.
IsNullOrEmpty
(
demodel
.
Name
))
if
(
string
.
IsNullOrEmpty
(
demodel
.
Name
))
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment