-
Notifications
You must be signed in to change notification settings - Fork 427
/
certify_test.go
89 lines (78 loc) · 2.15 KB
/
certify_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package alipay_test
import (
"context"
"testing"
"github.com/smartwalle/alipay/v3"
)
func TestClient_UserCertifyOpenInitialize(t *testing.T) {
t.Log("========== UserCertifyOpenInitialize ==========")
var p = alipay.UserCertifyOpenInitialize{}
p.OuterOrderNo = "xxxx"
p.BizCode = alipay.CertifyBizCodeFace
p.IdentityParam.IdentityType = "CERT_INFO"
p.IdentityParam.CertType = "IDENTITY_CARD"
p.IdentityParam.CertName = "沙箱环境"
p.IdentityParam.CertNo = "829297191402263571"
p.MerchantConfig.ReturnURL = "http://127.0.0.1"
rsp, err := client.UserCertifyOpenInitialize(context.Background(), p)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_UserCertifyOpenCertify(t *testing.T) {
t.Log("========== UserCertifyOpenCertify ==========")
var p = alipay.UserCertifyOpenCertify{}
p.CertifyId = "xxxx"
rsp, err := client.UserCertifyOpenCertify(p)
if err != nil {
t.Fatal(err)
}
t.Log(rsp)
}
func TestClient_UserCertifyOpenQuery(t *testing.T) {
t.Log("========== UserCertifyOpenQuery ==========")
var p = alipay.UserCertifyOpenQuery{}
p.CertifyId = "xxxx"
rsp, err := client.UserCertifyOpenQuery(context.Background(), p)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_UserCertdocCertverifyPreconsult(t *testing.T) {
t.Log("========== UserCertdocCertverifyPreconsult ==========")
var p = alipay.UserCertDocCertVerifyPreConsult{}
p.UserName = "xxxx"
p.CertType = "IDENTITY_CARD"
p.CertNo = "xxxx"
p.Mobile = "xxxx"
p.LogonId = "xxxx"
rsp, err := client.UserCertDocCertVerifyPreConsult(context.Background(), p)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}
func TestClient_UserCertdocCertverifyConsult(t *testing.T) {
t.Log("========== UserCertdocCertverifyConsult ==========")
var p = alipay.UserCertDocCertVerifyConsult{}
p.VerifyId = "xxxx"
rsp, err := client.UserCertDocCertVerifyConsult(context.Background(), p)
if err != nil {
t.Fatal(err)
}
if rsp.IsFailure() {
t.Fatal(rsp.Msg, rsp.SubMsg)
}
t.Logf("%v", rsp)
}