Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nlt-pufa-interface
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓梁
nlt-pufa-interface
Commits
19a65ea4
Commit
19a65ea4
authored
Sep 26, 2024
by
dliangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go test
parent
871afdc6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletions
+39
-1
handler/jump_url.go
+0
-1
handler/pay_result_test.go
+39
-0
No files found.
handler/jump_url.go
View file @
19a65ea4
...
...
@@ -59,5 +59,4 @@ func QueryJumpUrl(ctx context.Context, c *app.RequestContext) {
resp
.
Head
.
ServiceSn
=
req
.
Head
.
ServiceSn
resp
.
Response
=
url
c
.
JSON
(
consts
.
StatusOK
,
resp
)
return
}
handler/pay_result_test.go
0 → 100644
View file @
19a65ea4
package
handler
import
(
"fmt"
"testing"
"nlt.com/pf/model"
"nlt.com/pf/nltconst"
)
func
TestAuthEncrypt
(
t
*
testing
.
T
)
{
var
resp
model
.
HttpBodyResp
[
model
.
AuthResp
]
resp
.
Head
.
Code
=
"11111"
resp
.
Head
.
ServiceSn
=
"23555555"
resp
.
Head
.
ServiceTime
=
nltconst
.
GetNowTime
()
resp
.
Response
.
DirectURL
=
"https://baidu.com"
resp
.
Response
.
PayOrderNo
=
"2239999999"
cresp
,
err
:=
model
.
EncryptAndSign
(
resp
)
fmt
.
Println
(
cresp
)
fmt
.
Println
(
err
)
}
func
TestAuthDecrypt
(
t
*
testing
.
T
)
{
var
resp
model
.
HttpBodyResp
[
model
.
PayResultReq
]
resp
.
Head
.
Code
=
"11111"
resp
.
Head
.
ServiceSn
=
"23555555"
resp
.
Head
.
ServiceTime
=
nltconst
.
GetNowTime
()
resp
.
Response
.
DuebillNoOrg
=
"99999999999"
cresp
,
err
:=
model
.
EncryptAndSign
(
resp
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
}
var
res
model
.
CryptHttpBodyReq
[[]
byte
]
res
.
Request
.
Head
.
ServiceSn
=
cresp
.
Response
.
Head
.
ServiceSn
res
.
Request
.
Request
=
cresp
.
Response
.
Response
res
.
Signature
=
cresp
.
Signature
fmt
.
Println
(
res
)
model
.
VerifyAndDecrypt
[
model
.
AuthResp
](
res
)
}
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