Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
system_pay
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
王沛
system_pay
Commits
3876c2ad
Commit
3876c2ad
authored
Jul 20, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签名验证
parent
cac8c9ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
notice.go
controller/api/v1/pay/notice.go
+7
-4
No files found.
controller/api/v1/pay/notice.go
View file @
3876c2ad
...
@@ -46,17 +46,19 @@ func (l *PayController) WxNotice(c *gin.Context) {
...
@@ -46,17 +46,19 @@ func (l *PayController) WxNotice(c *gin.Context) {
base
.
ResponseWxNotice
(
c
,
response
)
base
.
ResponseWxNotice
(
c
,
response
)
return
return
}
}
//fmt.Println("验证签名成功...")
//fmt.Println("验证签名成功...未完...")
//response := new(base.ResponseDataWxNotice)
//response := new(base.ResponseDataWxNotice)
//response.Code = "SUCCESS"
//response.Code = "SUCCESS"
//response.Message = "执行成功"
//response.Message = "执行成功"
//base.ResponseWxNotice(c, response)
//base.ResponseWxNotice(c, response)
//return
//return
fmt
.
Println
(
"验证签名成功
...
"
)
fmt
.
Println
(
"验证签名成功"
)
ph
:=
new
(
models
.
WxNoticeInput
)
ph
:=
new
(
models
.
WxNoticeInput
)
err
=
c
.
ShouldBindJSON
(
ph
)
//err := c.ShouldBindJSON(ph)
err
=
c
.
ShouldBindBodyWith
(
&
ph
,
binding
.
JSON
)
if
err
!=
nil
{
if
err
!=
nil
{
response
:=
new
(
base
.
ResponseDataWxNotice
)
response
:=
new
(
base
.
ResponseDataWxNotice
)
response
.
Code
=
"FAIL"
response
.
Code
=
"FAIL"
...
@@ -128,7 +130,8 @@ func VerifySignCert(c *gin.Context) error {
...
@@ -128,7 +130,8 @@ func VerifySignCert(c *gin.Context) error {
//reqBody := string(b) //获取response body
//reqBody := string(b) //获取response body
var
body
interface
{}
var
body
interface
{}
if
err
=
c
.
ShouldBindBodyWith
(
&
body
,
binding
.
JSON
);
err
!=
nil
{
err
=
c
.
ShouldBindBodyWith
(
&
body
,
binding
.
JSON
)
if
err
!=
nil
{
//log.Default().Error("should bind body error", zap.Error(err))
//log.Default().Error("should bind body error", zap.Error(err))
fmt
.
Println
(
"should bind body error: "
+
err
.
Error
())
fmt
.
Println
(
"should bind body error: "
+
err
.
Error
())
return
err
return
err
...
...
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