Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
20287ec3
Commit
20287ec3
authored
May 12, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
87a88ad3
7608c857
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
RB_Order_Guest_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_Guest_ViewModel.cs
+1
-0
WeChatPayController.cs
Edu.WebApi/Controllers/WeChatPay/WeChatPayController.cs
+5
-4
No files found.
Edu.Model/ViewModel/Course/RB_Order_Guest_ViewModel.cs
View file @
20287ec3
...
...
@@ -41,6 +41,7 @@ namespace Edu.Model.ViewModel.Course
case
2
:
str
=
"退学"
;
break
;
case
3
:
str
=
"申请退学中"
;
break
;
case
4
:
str
=
"驳回申请"
;
break
;
case
5
:
str
=
"停课"
;
break
;
}
return
str
;
}
...
...
Edu.WebApi/Controllers/WeChatPay/WeChatPayController.cs
View file @
20287ec3
...
...
@@ -54,7 +54,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
[
HttpPost
]
[
AllowAnonymous
]
public
async
Task
<
NativePayModel
>
GenerateOrder
()
public
ApiResult
GenerateOrder
()
{
JObject
jobj
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
contractId
=
jobj
.
GetInt
(
"contractId"
);
...
...
@@ -63,15 +63,16 @@ namespace Edu.WebApi.Controllers.WeChatPay
LogHelper
.
WriteInfo
(
"合同Id:"
+
contractId
+
" 商户订单号:"
+
orderNumber
);
var
helper
=
new
WxPayHelper
(
WxPayConst
.
appid
,
WxPayConst
.
mchid
,
WxPayConst
.
serialNo
,
WxPayConst
.
privateKey
);
var
notify_url
=
Config
.
sTenpayNotifyUrl
;
//ConfigurationManager.AppSettings["notify_url"]; //这个放在配置文件,从配置文件读取比较灵活,或者写到数据库中
var
payodel
=
await
helper
.
UnionGenerateOrder
(
orderModle
.
CourseName
,
Convert
.
ToInt32
(
orderModle
.
Money
*
100
),
orderNumber
,
notify_url
,
orderModle
.
OrderId
.
ToString
());
Task
<
WxPayRespModel
>
payodel
=
helper
.
UnionGenerateOrder
(
orderModle
.
CourseName
,
Convert
.
ToInt32
(
orderModle
.
Money
*
100
),
orderNumber
,
notify_url
,
orderModle
.
OrderId
.
ToString
());
#
region
为
APP
生成下单所需的参数,看个人实际需求,也可以
APP
自己生成所需的参数
var
signModel
=
WxPayForAppHelper
.
GetSign
(
WxPayConst
.
appid
,
payodel
.
code_url
,
WxPayConst
.
privateKey
);
var
signModel
=
WxPayForAppHelper
.
GetSign
(
WxPayConst
.
appid
,
payodel
.
Result
.
code_url
,
WxPayConst
.
privateKey
);
#
endregion
return
signModel
;
//ApiResult.Success("",data:new { url = payodel.code_url, signModel }
) ;
return
ApiResult
.
Success
(
data
:
signModel
)
;
}
...
...
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