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
b27b92ea
Commit
b27b92ea
authored
May 28, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
83958d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+25
-5
No files found.
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
b27b92ea
...
@@ -242,7 +242,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -242,7 +242,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// </summary>
/// </summary>
/// <param name="param"></param>
/// <param name="param"></param>
/// <returns></returns>
/// <returns></returns>
public
BaseResult
Refund
(
PayParam
param
)
public
BaseResult
Refund
(
PayParam
param
,
RB_MiniProgram_Extend
model
)
{
{
App_Code
.
PayUtil
payUtil
=
new
App_Code
.
PayUtil
();
App_Code
.
PayUtil
payUtil
=
new
App_Code
.
PayUtil
();
...
@@ -251,8 +251,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -251,8 +251,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat
return
new
BaseResult
()
{
IsSuccess
=
false
,
Message
=
"参数错误!"
};
return
new
BaseResult
()
{
IsSuccess
=
false
,
Message
=
"参数错误!"
};
}
}
#
region
微信退款
#
region
微信退款
RB_MiniProgram_Extend
model
=
new
RB_MiniProgram_Extend
();
var
packageReq
=
new
RequestHandler
();
var
packageReq
=
new
RequestHandler
();
packageReq
.
SetKey
(
model
.
WeChatApiSecret
);
packageReq
.
SetKey
(
model
.
WeChatApiSecret
);
packageReq
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
packageReq
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
...
@@ -296,8 +294,30 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -296,8 +294,30 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
}
}
}
else
{
//查询退款情况
else
{
//查询退款情况
packageReq
=
new
RequestHandler
();
packageReq
.
SetKey
(
model
.
WeChatApiSecret
);
packageReq
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
packageReq
.
SetParameter
(
"mch_id"
,
model
.
WeChatPayMerchants
);
packageReq
.
SetParameter
(
"nonce_str"
,
payUtil
.
GetNoncestr
());
packageReq
.
SetParameter
(
"sign"
,
packageReq
.
CreateMd5Sign
(
_accessor
));
packageReq
.
SetParameter
(
"out_refund_no"
,
param
.
RefundNumber
);
reqXml
=
packageReq
.
ParseXml
();
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
{
Url
=
"https://api.mch.weixin.qq.com/pay/refundquery"
,
PostParam
=
reqXml
,
Encoding
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
GetRequestEncoding
(
_accessor
.
HttpContext
.
Request
),
});
xe
=
XElement
.
Parse
(
result
,
LoadOptions
.
SetLineInfo
);
returnCode
=
xe
.
GetElement
(
"return_code"
).
Value
;
if
(
returnCode
.
Equals
(
"SUCCESS"
))
{
}
}
}
var
errCodeDes
=
xe
.
GetElement
(
"err_code_des"
)
==
null
?
""
:
xe
.
GetElement
(
"err_code_des"
).
Value
;
var
errCodeDes
=
xe
.
GetElement
(
"err_code_des"
)
==
null
?
""
:
xe
.
GetElement
(
"err_code_des"
).
Value
;
var
returnMsg
=
xe
.
GetElement
(
"return_msg"
)
==
null
?
""
:
xe
.
GetElement
(
"return_msg"
).
Value
;
var
returnMsg
=
xe
.
GetElement
(
"return_msg"
)
==
null
?
""
:
xe
.
GetElement
(
"return_msg"
).
Value
;
...
...
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