forked from smartwalle/alipay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcertify_test.go
84 lines (77 loc) · 2.23 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
package alipay_test
import (
"testing"
alipay "github.com/trustasia-com/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(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.CodeSuccess {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.CertifyId)
}
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(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.CodeSuccess {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.Msg)
}
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(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.CodeSuccess {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.Msg)
}
func TestClient_UserCertdocCertverifyConsult(t *testing.T) {
t.Log("========== UserCertdocCertverifyConsult ==========")
var p = alipay.UserCertdocCertverifyConsult{}
p.VerifyId = "xxxx"
rsp, err := client.UserCertdocCertverifyConsult(p)
if err != nil {
t.Fatal(err)
}
if rsp.Content.Code != alipay.CodeSuccess {
t.Fatal(rsp.Content.Msg, rsp.Content.SubMsg)
}
t.Log(rsp.Content.Msg)
}