forked from smartwalle/alipay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
certify_test.go
52 lines (47 loc) · 1.35 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
package alipay_test
import (
"testing"
alipay "github.com/deoops-net/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)
}