Skip to content

Commit 8a3f614

Browse files
committed
Support faceverify.
1 parent b61e631 commit 8a3f614

File tree

9 files changed

+476
-14
lines changed

9 files changed

+476
-14
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2023-01-13 Version: 1.0.7
2+
- Support faceverify.
3+
14
2022-08-17 Version: 1.0.6
25
- Support ekyc.
36

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
],
1212
"require": {
1313
"php": ">5.5",
14-
"alibabacloud/tea-utils": "^0.2.16",
15-
"alibabacloud/darabonba-openapi": "^0.2.5",
16-
"alibabacloud/openapi-util": "^0.1.10",
14+
"alibabacloud/tea-utils": "^0.2.17",
15+
"alibabacloud/darabonba-openapi": "^0.2.8",
16+
"alibabacloud/openapi-util": "^0.1.10|^0.2.1",
1717
"alibabacloud/endpoint-util": "^0.1.0"
1818
},
1919
"autoload": {

src/Cloudauthintl.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use AlibabaCloud\OpenApiUtil\OpenApiUtilClient;
99
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckResultRequest;
1010
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckResultResponse;
11+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\FaceCompareRequest;
12+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\FaceCompareResponse;
1113
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\InitializeRequest;
1214
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\InitializeResponse;
1315
use AlibabaCloud\Tea\Utils\Utils;
@@ -104,6 +106,61 @@ public function checkResult($request)
104106
return $this->checkResultWithOptions($request, $runtime);
105107
}
106108

109+
/**
110+
* @param FaceCompareRequest $request
111+
* @param RuntimeOptions $runtime
112+
*
113+
* @return FaceCompareResponse
114+
*/
115+
public function faceCompareWithOptions($request, $runtime)
116+
{
117+
Utils::validateModel($request);
118+
$query = [];
119+
if (!Utils::isUnset($request->merchantBizId)) {
120+
$query['MerchantBizId'] = $request->merchantBizId;
121+
}
122+
if (!Utils::isUnset($request->sourceFacePicture)) {
123+
$query['SourceFacePicture'] = $request->sourceFacePicture;
124+
}
125+
if (!Utils::isUnset($request->sourceFacePictureUrl)) {
126+
$query['SourceFacePictureUrl'] = $request->sourceFacePictureUrl;
127+
}
128+
if (!Utils::isUnset($request->targetFacePicture)) {
129+
$query['TargetFacePicture'] = $request->targetFacePicture;
130+
}
131+
if (!Utils::isUnset($request->targetFacePictureUrl)) {
132+
$query['TargetFacePictureUrl'] = $request->targetFacePictureUrl;
133+
}
134+
$req = new OpenApiRequest([
135+
'query' => OpenApiUtilClient::query($query),
136+
]);
137+
$params = new Params([
138+
'action' => 'FaceCompare',
139+
'version' => '2022-08-09',
140+
'protocol' => 'HTTPS',
141+
'pathname' => '/',
142+
'method' => 'POST',
143+
'authType' => 'AK',
144+
'style' => 'RPC',
145+
'reqBodyType' => 'formData',
146+
'bodyType' => 'json',
147+
]);
148+
149+
return FaceCompareResponse::fromMap($this->callApi($params, $req, $runtime));
150+
}
151+
152+
/**
153+
* @param FaceCompareRequest $request
154+
*
155+
* @return FaceCompareResponse
156+
*/
157+
public function faceCompare($request)
158+
{
159+
$runtime = new RuntimeOptions([]);
160+
161+
return $this->faceCompareWithOptions($request, $runtime);
162+
}
163+
107164
/**
108165
* @param InitializeRequest $request
109166
* @param RuntimeOptions $runtime
@@ -117,6 +174,12 @@ public function initializeWithOptions($request, $runtime)
117174
if (!Utils::isUnset($request->docType)) {
118175
$query['DocType'] = $request->docType;
119176
}
177+
if (!Utils::isUnset($request->facePictureBase64)) {
178+
$query['FacePictureBase64'] = $request->facePictureBase64;
179+
}
180+
if (!Utils::isUnset($request->facePictureUrl)) {
181+
$query['FacePictureUrl'] = $request->facePictureUrl;
182+
}
120183
if (!Utils::isUnset($request->flowType)) {
121184
$query['FlowType'] = $request->flowType;
122185
}

src/Models/CheckResultResponseBody/result.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,24 @@ class result extends Model
3232
* @var string
3333
*/
3434
public $extRiskInfo;
35+
36+
/**
37+
* @var string
38+
*/
39+
public $passed;
40+
41+
/**
42+
* @var string
43+
*/
44+
public $subCode;
3545
protected $_name = [
3646
'ekycResult' => 'EkycResult',
3747
'extBasicInfo' => 'ExtBasicInfo',
3848
'extFaceInfo' => 'ExtFaceInfo',
3949
'extIdInfo' => 'ExtIdInfo',
4050
'extRiskInfo' => 'ExtRiskInfo',
51+
'passed' => 'Passed',
52+
'subCode' => 'SubCode',
4153
];
4254

4355
public function validate()
@@ -62,6 +74,12 @@ public function toMap()
6274
if (null !== $this->extRiskInfo) {
6375
$res['ExtRiskInfo'] = $this->extRiskInfo;
6476
}
77+
if (null !== $this->passed) {
78+
$res['Passed'] = $this->passed;
79+
}
80+
if (null !== $this->subCode) {
81+
$res['SubCode'] = $this->subCode;
82+
}
6583

6684
return $res;
6785
}
@@ -89,6 +107,12 @@ public static function fromMap($map = [])
89107
if (isset($map['ExtRiskInfo'])) {
90108
$model->extRiskInfo = $map['ExtRiskInfo'];
91109
}
110+
if (isset($map['Passed'])) {
111+
$model->passed = $map['Passed'];
112+
}
113+
if (isset($map['SubCode'])) {
114+
$model->subCode = $map['SubCode'];
115+
}
92116

93117
return $model;
94118
}

src/Models/FaceCompareRequest.php

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?php
2+
3+
// This file is auto-generated, don't edit it. Thanks.
4+
5+
namespace AlibabaCloud\SDK\Cloudauthintl\V20220809\Models;
6+
7+
use AlibabaCloud\Tea\Model;
8+
9+
class FaceCompareRequest extends Model
10+
{
11+
/**
12+
* @example e0c34a77f5ac40a5aa5e6ed20c353888
13+
*
14+
* @var string
15+
*/
16+
public $merchantBizId;
17+
18+
/**
19+
* @example /9j/4AAQSkZJRgABAQAASxxxxxxx
20+
*
21+
* @var string
22+
*/
23+
public $sourceFacePicture;
24+
25+
/**
26+
* @example https://***face1.jpeg
27+
*
28+
* @var string
29+
*/
30+
public $sourceFacePictureUrl;
31+
32+
/**
33+
* @example /9j/4AAQSkZJRgABAQAASxxxxxxx
34+
*
35+
* @var string
36+
*/
37+
public $targetFacePicture;
38+
39+
/**
40+
* @example https://***face2.jpeg
41+
*
42+
* @var string
43+
*/
44+
public $targetFacePictureUrl;
45+
protected $_name = [
46+
'merchantBizId' => 'MerchantBizId',
47+
'sourceFacePicture' => 'SourceFacePicture',
48+
'sourceFacePictureUrl' => 'SourceFacePictureUrl',
49+
'targetFacePicture' => 'TargetFacePicture',
50+
'targetFacePictureUrl' => 'TargetFacePictureUrl',
51+
];
52+
53+
public function validate()
54+
{
55+
}
56+
57+
public function toMap()
58+
{
59+
$res = [];
60+
if (null !== $this->merchantBizId) {
61+
$res['MerchantBizId'] = $this->merchantBizId;
62+
}
63+
if (null !== $this->sourceFacePicture) {
64+
$res['SourceFacePicture'] = $this->sourceFacePicture;
65+
}
66+
if (null !== $this->sourceFacePictureUrl) {
67+
$res['SourceFacePictureUrl'] = $this->sourceFacePictureUrl;
68+
}
69+
if (null !== $this->targetFacePicture) {
70+
$res['TargetFacePicture'] = $this->targetFacePicture;
71+
}
72+
if (null !== $this->targetFacePictureUrl) {
73+
$res['TargetFacePictureUrl'] = $this->targetFacePictureUrl;
74+
}
75+
76+
return $res;
77+
}
78+
79+
/**
80+
* @param array $map
81+
*
82+
* @return FaceCompareRequest
83+
*/
84+
public static function fromMap($map = [])
85+
{
86+
$model = new self();
87+
if (isset($map['MerchantBizId'])) {
88+
$model->merchantBizId = $map['MerchantBizId'];
89+
}
90+
if (isset($map['SourceFacePicture'])) {
91+
$model->sourceFacePicture = $map['SourceFacePicture'];
92+
}
93+
if (isset($map['SourceFacePictureUrl'])) {
94+
$model->sourceFacePictureUrl = $map['SourceFacePictureUrl'];
95+
}
96+
if (isset($map['TargetFacePicture'])) {
97+
$model->targetFacePicture = $map['TargetFacePicture'];
98+
}
99+
if (isset($map['TargetFacePictureUrl'])) {
100+
$model->targetFacePictureUrl = $map['TargetFacePictureUrl'];
101+
}
102+
103+
return $model;
104+
}
105+
}

src/Models/FaceCompareResponse.php

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
// This file is auto-generated, don't edit it. Thanks.
4+
5+
namespace AlibabaCloud\SDK\Cloudauthintl\V20220809\Models;
6+
7+
use AlibabaCloud\Tea\Model;
8+
9+
class FaceCompareResponse extends Model
10+
{
11+
/**
12+
* @var string[]
13+
*/
14+
public $headers;
15+
16+
/**
17+
* @var int
18+
*/
19+
public $statusCode;
20+
21+
/**
22+
* @var FaceCompareResponseBody
23+
*/
24+
public $body;
25+
protected $_name = [
26+
'headers' => 'headers',
27+
'statusCode' => 'statusCode',
28+
'body' => 'body',
29+
];
30+
31+
public function validate()
32+
{
33+
Model::validateRequired('headers', $this->headers, true);
34+
Model::validateRequired('statusCode', $this->statusCode, true);
35+
Model::validateRequired('body', $this->body, true);
36+
}
37+
38+
public function toMap()
39+
{
40+
$res = [];
41+
if (null !== $this->headers) {
42+
$res['headers'] = $this->headers;
43+
}
44+
if (null !== $this->statusCode) {
45+
$res['statusCode'] = $this->statusCode;
46+
}
47+
if (null !== $this->body) {
48+
$res['body'] = null !== $this->body ? $this->body->toMap() : null;
49+
}
50+
51+
return $res;
52+
}
53+
54+
/**
55+
* @param array $map
56+
*
57+
* @return FaceCompareResponse
58+
*/
59+
public static function fromMap($map = [])
60+
{
61+
$model = new self();
62+
if (isset($map['headers'])) {
63+
$model->headers = $map['headers'];
64+
}
65+
if (isset($map['statusCode'])) {
66+
$model->statusCode = $map['statusCode'];
67+
}
68+
if (isset($map['body'])) {
69+
$model->body = FaceCompareResponseBody::fromMap($map['body']);
70+
}
71+
72+
return $model;
73+
}
74+
}

0 commit comments

Comments
 (0)