From 8f572db4a77f3eb228ead508698d1ab157e6c6bf Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Wed, 18 Dec 2024 17:09:56 +0800 Subject: [PATCH] add new api --- alipay/face.go | 2 +- alipay/v3/constant.go | 4 +- alipay/v3/face_verify_api.go | 408 +++++++++++++++++++++++++++++++++ alipay/v3/model_face_verify.go | 127 ++++++++++ doc/alipay_v3.md | 16 ++ 5 files changed, 555 insertions(+), 2 deletions(-) create mode 100644 alipay/v3/face_verify_api.go create mode 100644 alipay/v3/model_face_verify.go diff --git a/alipay/face.go b/alipay/face.go index 850606fa..355a8f1a 100644 --- a/alipay/face.go +++ b/alipay/face.go @@ -57,7 +57,7 @@ func (a *Client) FaceVerificationQuery(ctx context.Context, bm gopay.BodyMap) (a // datadigital.fincloud.generalsaas.face.certify.initialize(H5人脸核身初始化) // 文档地址:https://opendocs.alipay.com/open/02zloa func (a *Client) FaceCertifyInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceCertifyInitializeRsp, err error) { - err = bm.CheckEmptyError("outer_order_no", "biz_code", "identity_param", "merchant_config") + err = bm.CheckEmptyError("outer_order_no", "identity_param", "merchant_config") if err != nil { return nil, err } diff --git a/alipay/v3/constant.go b/alipay/v3/constant.go index 32a09fc3..0bbe6d5e 100644 --- a/alipay/v3/constant.go +++ b/alipay/v3/constant.go @@ -77,8 +77,10 @@ const ( v3FaceSourceCertify = "/v3/datadigital/fincloud/generalsaas/face/source/certify" // 纯服务端人脸核身 v3FaceCheckInitialize = "/v3/datadigital/fincloud/generalsaas/face/check/initialize" // 活体检测初始化 v3FaceCheckQuery = "/v3/datadigital/fincloud/generalsaas/face/check/query" // 活体检测结果查询 - v3IdCardTwoMetaCheck = "/v3/datadigital/fincloud/generalsaas/twometa/check" // 身份证二要素核验 + v3IDCardTwoMetaCheck = "/v3/datadigital/fincloud/generalsaas/twometa/check" // 身份证二要素核验 v3BankCardCheck = "/v3/datadigital/fincloud/generalsaas/bankcard/check" // 银行卡核验 + v3MobileThreeMetaSimpleCheck = "/v3/datadigital/fincloud/generalsaas/mobilethreemeta/simple/check" // 手机号三要素核验简版 + v3MobileThreeMetaDetailCheck = "/v3/datadigital/fincloud/generalsaas/mobilethreemeta/detail/check" // 手机号三要素核验详版 v3OcrServerDetect = "/v3/datadigital/fincloud/generalsaas/ocr/server/detect" // 服务端OCR v3OcrMobileInitialize = "/v3/datadigital/fincloud/generalsaas/ocr/mobile/initialize" // App端OCR初始化 ) diff --git a/alipay/v3/face_verify_api.go b/alipay/v3/face_verify_api.go new file mode 100644 index 00000000..b281f400 --- /dev/null +++ b/alipay/v3/face_verify_api.go @@ -0,0 +1,408 @@ +package alipay + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/go-pay/gopay" +) + +// 人脸核身初始化 datadigital.fincloud.generalsaas.face.verification.initialize +// StatusCode = 200 is success +func (a *ClientV3) FaceVerificationInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceVerificationInitializeRsp, err error) { + err = bm.CheckEmptyError("outer_order_no", "biz_code", "identity_type", "cert_type", "cert_name", "cert_no") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3FaceVerificationInitialize, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3FaceVerificationInitialize, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceVerificationInitializeRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 人脸核身结果查询 datadigital.fincloud.generalsaas.face.verification.query +// StatusCode = 200 is success +func (a *ClientV3) FaceVerificationQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceVerificationQueryRsp, err error) { + err = bm.CheckEmptyError("certify_id") + if err != nil { + return nil, err + } + uri := v3FaceVerificationQuery + "?" + bm.EncodeURLParams() + authorization, err := a.authorization(MethodGet, uri, nil) + if err != nil { + return nil, err + } + res, bs, err := a.doGet(ctx, uri, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceVerificationQueryRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 跳转支付宝人脸核身初始化 datadigital.fincloud.generalsaas.face.certify.initialize +// StatusCode = 200 is success +func (a *ClientV3) FaceCertifyInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceCertifyInitializeRsp, err error) { + err = bm.CheckEmptyError("outer_order_no", "identity_param", "merchant_config") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3FaceCertifyInitialize, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3FaceCertifyInitialize, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceCertifyInitializeRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 跳转支付宝人脸核身开始认证 datadigital.fincloud.generalsaas.face.certify.verify +// StatusCode = 200 is success +func (a *ClientV3) FaceCertifyVerify(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceCertifyVerifyRsp, err error) { + err = bm.CheckEmptyError("certify_id") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3FaceCertifyVerify, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3FaceCertifyVerify, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceCertifyVerifyRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 跳转支付宝人脸核身查询记录 datadigital.fincloud.generalsaas.face.certify.query +// StatusCode = 200 is success +func (a *ClientV3) FaceCertifyQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceCertifyQueryRsp, err error) { + err = bm.CheckEmptyError("certify_id") + if err != nil { + return nil, err + } + uri := v3FaceCertifyQuery + "?" + bm.EncodeURLParams() + authorization, err := a.authorization(MethodGet, uri, nil) + if err != nil { + return nil, err + } + res, bs, err := a.doGet(ctx, uri, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceCertifyQueryRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 纯服务端人脸核身 datadigital.fincloud.generalsaas.face.source.certify +// StatusCode = 200 is success +func (a *ClientV3) FaceSourceCertify(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceSourceCertifyRsp, err error) { + err = bm.CheckEmptyError("outer_biz_no", "cert_type", "cert_no", "cert_name") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3FaceSourceCertify, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3FaceSourceCertify, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceSourceCertifyRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 活体检测初始化 datadigital.fincloud.generalsaas.face.check.initialize +// StatusCode = 200 is success +func (a *ClientV3) FaceCheckInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceCheckInitializeRsp, err error) { + err = bm.CheckEmptyError("outer_order_no", "biz_code") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3FaceCheckInitialize, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3FaceCheckInitialize, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceCheckInitializeRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 活体检测结果查询 datadigital.fincloud.generalsaas.face.check.query +// StatusCode = 200 is success +func (a *ClientV3) FaceCheckQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *FaceCheckQueryRsp, err error) { + err = bm.CheckEmptyError("certify_id") + if err != nil { + return nil, err + } + uri := v3FaceCheckQuery + "?" + bm.EncodeURLParams() + authorization, err := a.authorization(MethodGet, uri, nil) + if err != nil { + return nil, err + } + res, bs, err := a.doGet(ctx, uri, authorization) + if err != nil { + return nil, err + } + aliRsp = &FaceCheckQueryRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 身份证二要素核验 datadigital.fincloud.generalsaas.twometa.check +// StatusCode = 200 is success +func (a *ClientV3) IDCardTwoMetaCheck(ctx context.Context, bm gopay.BodyMap) (aliRsp *IDCardTwoMetaCheckRsp, err error) { + err = bm.CheckEmptyError("outer_biz_no", "cert_name", "cert_no", "cert_type") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3IDCardTwoMetaCheck, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3IDCardTwoMetaCheck, authorization) + if err != nil { + return nil, err + } + aliRsp = &IDCardTwoMetaCheckRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 银行卡核验 datadigital.fincloud.generalsaas.bankcard.check +// StatusCode = 200 is success +func (a *ClientV3) BankCardCheck(ctx context.Context, bm gopay.BodyMap) (aliRsp *BankCardCheckRsp, err error) { + err = bm.CheckEmptyError("outer_biz_no", "product_type", "cert_name", "bankcard_no") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3BankCardCheck, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3BankCardCheck, authorization) + if err != nil { + return nil, err + } + aliRsp = &BankCardCheckRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 手机号三要素核验简版 datadigital.fincloud.generalsaas.mobilethreemeta.simple.check +// StatusCode = 200 is success +func (a *ClientV3) MobileThreeMetaSimpleCheck(ctx context.Context, bm gopay.BodyMap) (aliRsp *MobileThreeMetaSimpleCheckRsp, err error) { + err = bm.CheckEmptyError("outer_biz_no", "cert_name", "cert_no", "phone") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3MobileThreeMetaSimpleCheck, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3MobileThreeMetaSimpleCheck, authorization) + if err != nil { + return nil, err + } + aliRsp = &MobileThreeMetaSimpleCheckRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 手机号三要素核验详版 datadigital.fincloud.generalsaas.mobilethreemeta.detail.check +// StatusCode = 200 is success +func (a *ClientV3) MobileThreeMetaDetailCheck(ctx context.Context, bm gopay.BodyMap) (aliRsp *MobileThreeMetaDetailCheckRsp, err error) { + err = bm.CheckEmptyError("outer_biz_no", "cert_name", "cert_no", "phone") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3MobileThreeMetaDetailCheck, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3MobileThreeMetaDetailCheck, authorization) + if err != nil { + return nil, err + } + aliRsp = &MobileThreeMetaDetailCheckRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// 服务端OCR datadigital.fincloud.generalsaas.ocr.server.detect +// StatusCode = 200 is success +func (a *ClientV3) OcrServerDetect(ctx context.Context, bm gopay.BodyMap) (aliRsp *OcrServerDetectRsp, err error) { + err = bm.CheckEmptyError("ocr_type", "outer_order_no") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3OcrServerDetect, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3OcrServerDetect, authorization) + if err != nil { + return nil, err + } + aliRsp = &OcrServerDetectRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} + +// App端OCR初始化 datadigital.fincloud.generalsaas.ocr.mobile.initialize +// StatusCode = 200 is success +func (a *ClientV3) OcrMobileInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *OcrMobileInitializeRsp, err error) { + err = bm.CheckEmptyError("biz_code", "outer_order_no") + if err != nil { + return nil, err + } + authorization, err := a.authorization(MethodPost, v3OcrMobileInitialize, bm) + if err != nil { + return nil, err + } + res, bs, err := a.doPost(ctx, bm, v3OcrMobileInitialize, authorization) + if err != nil { + return nil, err + } + aliRsp = &OcrMobileInitializeRsp{StatusCode: res.StatusCode} + if res.StatusCode != http.StatusOK { + if err = json.Unmarshal(bs, &aliRsp.ErrResponse); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, nil + } + if err = json.Unmarshal(bs, aliRsp); err != nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + return aliRsp, a.autoVerifySignByCert(res, bs) +} diff --git a/alipay/v3/model_face_verify.go b/alipay/v3/model_face_verify.go new file mode 100644 index 00000000..7142a04f --- /dev/null +++ b/alipay/v3/model_face_verify.go @@ -0,0 +1,127 @@ +package alipay + +type FaceVerificationInitializeRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` + WebUrl string `json:"web_url"` +} + +type FaceVerificationQueryRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyState string `json:"certify_state"` + Score string `json:"score"` + Quality string `json:"quality"` + AlivePhoto string `json:"alive_photo"` + AttackFlag string `json:"attack_flag"` + MetaInfo *MetaInfo `json:"meta_info"` +} + +type MetaInfo struct { + DeviceType string `json:"device_type"` +} + +type FaceCertifyInitializeRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` +} + +type FaceCertifyVerifyRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyUrl string `json:"certify_url"` +} + +type FaceCertifyQueryRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + Passed string `json:"passed"` +} + +type FaceSourceCertifyRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyNo string `json:"certify_no"` + Passed string `json:"passed"` + Score string `json:"score"` + Quality string `json:"quality"` + MismatchReason string `json:"mismatch_reason"` +} + +type FaceCheckInitializeRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` + WebUrl string `json:"web_url"` +} + +type FaceCheckQueryRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyState string `json:"certify_state"` + Quality string `json:"quality"` + AlivePhoto string `json:"alive_photo"` + MetaInfo *MetaInfo `json:"meta_info"` +} + +type IDCardTwoMetaCheckRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` + Match string `json:"match"` +} + +type BankCardCheckRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` + Match string `json:"match"` + Detail string `json:"detail"` +} + +type MobileThreeMetaSimpleCheckRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` + Match string `json:"match"` + Isp string `json:"isp"` + Detail string `json:"detail"` +} + +type MobileThreeMetaDetailCheckRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` + Match string `json:"match"` + Isp string `json:"isp"` + Detail string `json:"detail"` +} + +type OcrServerDetectRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + OcrData string `json:"ocr_data"` + CertifyId string `json:"certify_id"` +} + +type OcrMobileInitializeRsp struct { + StatusCode int `json:"status_code"` + ErrResponse ErrResponse `json:"-"` + + CertifyId string `json:"certify_id"` +} diff --git a/doc/alipay_v3.md b/doc/alipay_v3.md index 557efbd8..292870de 100644 --- a/doc/alipay_v3.md +++ b/doc/alipay_v3.md @@ -219,4 +219,20 @@ return c.String(http.StatusOK, "success") * 支付宝会员授权信息查询接口:`client.UserInfoShare()` * 用户授权关系查询:`client.UserAuthRelationshipQuery()` * 查询解除授权明细:`client.UserDelOauthDetailQuery()` +* 人脸认证 + * 人脸核身初始化:`client.FaceVerificationInitialize()` + * 人脸核身结果查询:`client.FaceVerificationQuery()` + * 跳转支付宝人脸核身初始化:`client.FaceCertifyInitialize()` + * 跳转支付宝人脸核身开始认证:`client.FaceCertifyVerify()` + * 跳转支付宝人脸核身查询记录:`client.FaceCertifyQuery()` + * 纯服务端人脸核身:`client.FaceSourceCertify()` + * 活体检测初始化:`client.FaceCheckInitialize()` + * 活体检测结果查询:`client.FaceCheckQuery()` + * 身份证二要素核验:`client.IDCardTwoMetaCheck()` + * 银行卡核验:`client.BankCardCheck()` + * 手机号三要素核验简版:`client.MobileThreeMetaSimpleCheck()` + * 手机号三要素核验详版:`client.MobileThreeMetaDetailCheck()` + * 服务端OCR:`client.OcrServerDetect()` + * App端OCR初始化:`client.OcrMobileInitialize()` + ### 支付宝公共 API