Skip to content

Commit 84b54f6

Browse files
committed
Support ekyc.
1 parent f97e9be commit 84b54f6

File tree

6 files changed

+488
-0
lines changed

6 files changed

+488
-0
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2023-06-01 Version: 1.0.11
2+
- Support ekyc.
3+
14
2023-05-10 Version: 1.0.10
25
- Support ekyc.
36

src/Cloudauthintl.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use AlibabaCloud\Endpoint\Endpoint;
88
use AlibabaCloud\OpenApiUtil\OpenApiUtilClient;
9+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CardOcrRequest;
10+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CardOcrResponse;
911
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckResultRequest;
1012
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckResultResponse;
1113
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DescribeAddressLabelsRequest;
@@ -63,6 +65,73 @@ public function getEndpoint($productId, $regionId, $endpointRule, $network, $suf
6365
return Endpoint::getEndpointRules($productId, $regionId, $endpointRule, $network, $suffix);
6466
}
6567

68+
/**
69+
* @param CardOcrRequest $request
70+
* @param RuntimeOptions $runtime
71+
*
72+
* @return CardOcrResponse
73+
*/
74+
public function cardOcrWithOptions($request, $runtime)
75+
{
76+
Utils::validateModel($request);
77+
$query = [];
78+
if (!Utils::isUnset($request->docType)) {
79+
$query['DocType'] = $request->docType;
80+
}
81+
if (!Utils::isUnset($request->idFaceQuality)) {
82+
$query['IdFaceQuality'] = $request->idFaceQuality;
83+
}
84+
if (!Utils::isUnset($request->idOcrPictureBase64)) {
85+
$query['IdOcrPictureBase64'] = $request->idOcrPictureBase64;
86+
}
87+
if (!Utils::isUnset($request->idOcrPictureUrl)) {
88+
$query['IdOcrPictureUrl'] = $request->idOcrPictureUrl;
89+
}
90+
if (!Utils::isUnset($request->merchantBizId)) {
91+
$query['MerchantBizId'] = $request->merchantBizId;
92+
}
93+
if (!Utils::isUnset($request->merchantUserId)) {
94+
$query['MerchantUserId'] = $request->merchantUserId;
95+
}
96+
if (!Utils::isUnset($request->ocr)) {
97+
$query['Ocr'] = $request->ocr;
98+
}
99+
if (!Utils::isUnset($request->productCode)) {
100+
$query['ProductCode'] = $request->productCode;
101+
}
102+
if (!Utils::isUnset($request->spoof)) {
103+
$query['Spoof'] = $request->spoof;
104+
}
105+
$req = new OpenApiRequest([
106+
'query' => OpenApiUtilClient::query($query),
107+
]);
108+
$params = new Params([
109+
'action' => 'CardOcr',
110+
'version' => '2022-08-09',
111+
'protocol' => 'HTTPS',
112+
'pathname' => '/',
113+
'method' => 'POST',
114+
'authType' => 'AK',
115+
'style' => 'RPC',
116+
'reqBodyType' => 'formData',
117+
'bodyType' => 'json',
118+
]);
119+
120+
return CardOcrResponse::fromMap($this->callApi($params, $req, $runtime));
121+
}
122+
123+
/**
124+
* @param CardOcrRequest $request
125+
*
126+
* @return CardOcrResponse
127+
*/
128+
public function cardOcr($request)
129+
{
130+
$runtime = new RuntimeOptions([]);
131+
132+
return $this->cardOcrWithOptions($request, $runtime);
133+
}
134+
66135
/**
67136
* @param CheckResultRequest $request
68137
* @param RuntimeOptions $runtime

src/Models/CardOcrRequest.php

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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 CardOcrRequest extends Model
10+
{
11+
/**
12+
* @example 00000006
13+
*
14+
* @var string
15+
*/
16+
public $docType;
17+
18+
/**
19+
* @example F
20+
*
21+
* @var string
22+
*/
23+
public $idFaceQuality;
24+
25+
/**
26+
* @example dsjisaj***oekwodsm
27+
*
28+
* @var string
29+
*/
30+
public $idOcrPictureBase64;
31+
32+
/**
33+
* @example https://digital-cardocr-prod8.oss-cn-hangzhou.aliyuncs.com/1669520556530-expo/default/face/20221127114236530_w3kx2e6t.jpg
34+
*
35+
* @var string
36+
*/
37+
public $idOcrPictureUrl;
38+
39+
/**
40+
* @example dso9322***dsjsd22
41+
*
42+
* @var string
43+
*/
44+
public $merchantBizId;
45+
46+
/**
47+
* @example 123456789
48+
*
49+
* @var string
50+
*/
51+
public $merchantUserId;
52+
53+
/**
54+
* @example T
55+
*
56+
* @var string
57+
*/
58+
public $ocr;
59+
60+
/**
61+
* @example ID_OCR_MIN
62+
*
63+
* @var string
64+
*/
65+
public $productCode;
66+
67+
/**
68+
* @example F
69+
*
70+
* @var string
71+
*/
72+
public $spoof;
73+
protected $_name = [
74+
'docType' => 'DocType',
75+
'idFaceQuality' => 'IdFaceQuality',
76+
'idOcrPictureBase64' => 'IdOcrPictureBase64',
77+
'idOcrPictureUrl' => 'IdOcrPictureUrl',
78+
'merchantBizId' => 'MerchantBizId',
79+
'merchantUserId' => 'MerchantUserId',
80+
'ocr' => 'Ocr',
81+
'productCode' => 'ProductCode',
82+
'spoof' => 'Spoof',
83+
];
84+
85+
public function validate()
86+
{
87+
}
88+
89+
public function toMap()
90+
{
91+
$res = [];
92+
if (null !== $this->docType) {
93+
$res['DocType'] = $this->docType;
94+
}
95+
if (null !== $this->idFaceQuality) {
96+
$res['IdFaceQuality'] = $this->idFaceQuality;
97+
}
98+
if (null !== $this->idOcrPictureBase64) {
99+
$res['IdOcrPictureBase64'] = $this->idOcrPictureBase64;
100+
}
101+
if (null !== $this->idOcrPictureUrl) {
102+
$res['IdOcrPictureUrl'] = $this->idOcrPictureUrl;
103+
}
104+
if (null !== $this->merchantBizId) {
105+
$res['MerchantBizId'] = $this->merchantBizId;
106+
}
107+
if (null !== $this->merchantUserId) {
108+
$res['MerchantUserId'] = $this->merchantUserId;
109+
}
110+
if (null !== $this->ocr) {
111+
$res['Ocr'] = $this->ocr;
112+
}
113+
if (null !== $this->productCode) {
114+
$res['ProductCode'] = $this->productCode;
115+
}
116+
if (null !== $this->spoof) {
117+
$res['Spoof'] = $this->spoof;
118+
}
119+
120+
return $res;
121+
}
122+
123+
/**
124+
* @param array $map
125+
*
126+
* @return CardOcrRequest
127+
*/
128+
public static function fromMap($map = [])
129+
{
130+
$model = new self();
131+
if (isset($map['DocType'])) {
132+
$model->docType = $map['DocType'];
133+
}
134+
if (isset($map['IdFaceQuality'])) {
135+
$model->idFaceQuality = $map['IdFaceQuality'];
136+
}
137+
if (isset($map['IdOcrPictureBase64'])) {
138+
$model->idOcrPictureBase64 = $map['IdOcrPictureBase64'];
139+
}
140+
if (isset($map['IdOcrPictureUrl'])) {
141+
$model->idOcrPictureUrl = $map['IdOcrPictureUrl'];
142+
}
143+
if (isset($map['MerchantBizId'])) {
144+
$model->merchantBizId = $map['MerchantBizId'];
145+
}
146+
if (isset($map['MerchantUserId'])) {
147+
$model->merchantUserId = $map['MerchantUserId'];
148+
}
149+
if (isset($map['Ocr'])) {
150+
$model->ocr = $map['Ocr'];
151+
}
152+
if (isset($map['ProductCode'])) {
153+
$model->productCode = $map['ProductCode'];
154+
}
155+
if (isset($map['Spoof'])) {
156+
$model->spoof = $map['Spoof'];
157+
}
158+
159+
return $model;
160+
}
161+
}

src/Models/CardOcrResponse.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 CardOcrResponse extends Model
10+
{
11+
/**
12+
* @var string[]
13+
*/
14+
public $headers;
15+
16+
/**
17+
* @var int
18+
*/
19+
public $statusCode;
20+
21+
/**
22+
* @var CardOcrResponseBody
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 CardOcrResponse
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 = CardOcrResponseBody::fromMap($map['body']);
70+
}
71+
72+
return $model;
73+
}
74+
}

0 commit comments

Comments
 (0)