Skip to content

Commit 8d54c9b

Browse files
committed
Support ekyc.
1 parent 84b54f6 commit 8d54c9b

File tree

7 files changed

+511
-5
lines changed

7 files changed

+511
-5
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-08 Version: 1.0.12
2+
- Support ekyc.
3+
14
2023-06-01 Version: 1.0.11
25
- Support ekyc.
36

src/Cloudauthintl.php

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DescribeRiskScoreResponse;
2121
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DescribeTransactionsListRequest;
2222
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DescribeTransactionsListResponse;
23+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DocOcrRequest;
24+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DocOcrResponse;
2325
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\FaceCompareRequest;
2426
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\FaceCompareResponse;
2527
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\FaceLivenessRequest;
@@ -66,10 +68,14 @@ public function getEndpoint($productId, $regionId, $endpointRule, $network, $suf
6668
}
6769

6870
/**
69-
* @param CardOcrRequest $request
70-
* @param RuntimeOptions $runtime
71+
* @deprecated : CardOcr is deprecated, please use Cloudauth-intl::2022-08-09::DocOcr instead.
72+
* *
73+
* Deprecated
74+
*
75+
* @param CardOcrRequest $request CardOcrRequest
76+
* @param RuntimeOptions $runtime runtime options for this request RuntimeOptions
7177
*
72-
* @return CardOcrResponse
78+
* @return CardOcrResponse CardOcrResponse
7379
*/
7480
public function cardOcrWithOptions($request, $runtime)
7581
{
@@ -121,9 +127,13 @@ public function cardOcrWithOptions($request, $runtime)
121127
}
122128

123129
/**
124-
* @param CardOcrRequest $request
130+
* @deprecated : CardOcr is deprecated, please use Cloudauth-intl::2022-08-09::DocOcr instead.
131+
* *
132+
* Deprecated
125133
*
126-
* @return CardOcrResponse
134+
* @param CardOcrRequest $request CardOcrRequest
135+
*
136+
* @return CardOcrResponse CardOcrResponse
127137
*/
128138
public function cardOcr($request)
129139
{
@@ -447,6 +457,73 @@ public function describeTransactionsList($request)
447457
return $this->describeTransactionsListWithOptions($request, $runtime);
448458
}
449459

460+
/**
461+
* @param DocOcrRequest $request
462+
* @param RuntimeOptions $runtime
463+
*
464+
* @return DocOcrResponse
465+
*/
466+
public function docOcrWithOptions($request, $runtime)
467+
{
468+
Utils::validateModel($request);
469+
$query = [];
470+
if (!Utils::isUnset($request->docType)) {
471+
$query['DocType'] = $request->docType;
472+
}
473+
if (!Utils::isUnset($request->idFaceQuality)) {
474+
$query['IdFaceQuality'] = $request->idFaceQuality;
475+
}
476+
if (!Utils::isUnset($request->idOcrPictureBase64)) {
477+
$query['IdOcrPictureBase64'] = $request->idOcrPictureBase64;
478+
}
479+
if (!Utils::isUnset($request->idOcrPictureUrl)) {
480+
$query['IdOcrPictureUrl'] = $request->idOcrPictureUrl;
481+
}
482+
if (!Utils::isUnset($request->merchantBizId)) {
483+
$query['MerchantBizId'] = $request->merchantBizId;
484+
}
485+
if (!Utils::isUnset($request->merchantUserId)) {
486+
$query['MerchantUserId'] = $request->merchantUserId;
487+
}
488+
if (!Utils::isUnset($request->ocr)) {
489+
$query['Ocr'] = $request->ocr;
490+
}
491+
if (!Utils::isUnset($request->productCode)) {
492+
$query['ProductCode'] = $request->productCode;
493+
}
494+
if (!Utils::isUnset($request->spoof)) {
495+
$query['Spoof'] = $request->spoof;
496+
}
497+
$req = new OpenApiRequest([
498+
'query' => OpenApiUtilClient::query($query),
499+
]);
500+
$params = new Params([
501+
'action' => 'DocOcr',
502+
'version' => '2022-08-09',
503+
'protocol' => 'HTTPS',
504+
'pathname' => '/',
505+
'method' => 'POST',
506+
'authType' => 'AK',
507+
'style' => 'RPC',
508+
'reqBodyType' => 'formData',
509+
'bodyType' => 'json',
510+
]);
511+
512+
return DocOcrResponse::fromMap($this->callApi($params, $req, $runtime));
513+
}
514+
515+
/**
516+
* @param DocOcrRequest $request
517+
*
518+
* @return DocOcrResponse
519+
*/
520+
public function docOcr($request)
521+
{
522+
$runtime = new RuntimeOptions([]);
523+
524+
return $this->docOcrWithOptions($request, $runtime);
525+
}
526+
450527
/**
451528
* @param FaceCompareRequest $request
452529
* @param RuntimeOptions $runtime

src/Models/CardOcrResponseBody/result.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class result extends Model
1313
*/
1414
public $extCardInfo;
1515

16+
/**
17+
* @var string
18+
*/
19+
public $extIdInfo;
20+
1621
/**
1722
* @example Y
1823
*
@@ -35,6 +40,7 @@ class result extends Model
3540
public $transactionId;
3641
protected $_name = [
3742
'extCardInfo' => 'ExtCardInfo',
43+
'extIdInfo' => 'ExtIdInfo',
3844
'passed' => 'Passed',
3945
'subCode' => 'SubCode',
4046
'transactionId' => 'TransactionId',
@@ -50,6 +56,9 @@ public function toMap()
5056
if (null !== $this->extCardInfo) {
5157
$res['ExtCardInfo'] = $this->extCardInfo;
5258
}
59+
if (null !== $this->extIdInfo) {
60+
$res['ExtIdInfo'] = $this->extIdInfo;
61+
}
5362
if (null !== $this->passed) {
5463
$res['Passed'] = $this->passed;
5564
}
@@ -74,6 +83,9 @@ public static function fromMap($map = [])
7483
if (isset($map['ExtCardInfo'])) {
7584
$model->extCardInfo = $map['ExtCardInfo'];
7685
}
86+
if (isset($map['ExtIdInfo'])) {
87+
$model->extIdInfo = $map['ExtIdInfo'];
88+
}
7789
if (isset($map['Passed'])) {
7890
$model->passed = $map['Passed'];
7991
}

src/Models/DocOcrRequest.php

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
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 DocOcrRequest 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+
* @var string
62+
*/
63+
public $productCode;
64+
65+
/**
66+
* @example F
67+
*
68+
* @var string
69+
*/
70+
public $spoof;
71+
protected $_name = [
72+
'docType' => 'DocType',
73+
'idFaceQuality' => 'IdFaceQuality',
74+
'idOcrPictureBase64' => 'IdOcrPictureBase64',
75+
'idOcrPictureUrl' => 'IdOcrPictureUrl',
76+
'merchantBizId' => 'MerchantBizId',
77+
'merchantUserId' => 'MerchantUserId',
78+
'ocr' => 'Ocr',
79+
'productCode' => 'ProductCode',
80+
'spoof' => 'Spoof',
81+
];
82+
83+
public function validate()
84+
{
85+
}
86+
87+
public function toMap()
88+
{
89+
$res = [];
90+
if (null !== $this->docType) {
91+
$res['DocType'] = $this->docType;
92+
}
93+
if (null !== $this->idFaceQuality) {
94+
$res['IdFaceQuality'] = $this->idFaceQuality;
95+
}
96+
if (null !== $this->idOcrPictureBase64) {
97+
$res['IdOcrPictureBase64'] = $this->idOcrPictureBase64;
98+
}
99+
if (null !== $this->idOcrPictureUrl) {
100+
$res['IdOcrPictureUrl'] = $this->idOcrPictureUrl;
101+
}
102+
if (null !== $this->merchantBizId) {
103+
$res['MerchantBizId'] = $this->merchantBizId;
104+
}
105+
if (null !== $this->merchantUserId) {
106+
$res['MerchantUserId'] = $this->merchantUserId;
107+
}
108+
if (null !== $this->ocr) {
109+
$res['Ocr'] = $this->ocr;
110+
}
111+
if (null !== $this->productCode) {
112+
$res['ProductCode'] = $this->productCode;
113+
}
114+
if (null !== $this->spoof) {
115+
$res['Spoof'] = $this->spoof;
116+
}
117+
118+
return $res;
119+
}
120+
121+
/**
122+
* @param array $map
123+
*
124+
* @return DocOcrRequest
125+
*/
126+
public static function fromMap($map = [])
127+
{
128+
$model = new self();
129+
if (isset($map['DocType'])) {
130+
$model->docType = $map['DocType'];
131+
}
132+
if (isset($map['IdFaceQuality'])) {
133+
$model->idFaceQuality = $map['IdFaceQuality'];
134+
}
135+
if (isset($map['IdOcrPictureBase64'])) {
136+
$model->idOcrPictureBase64 = $map['IdOcrPictureBase64'];
137+
}
138+
if (isset($map['IdOcrPictureUrl'])) {
139+
$model->idOcrPictureUrl = $map['IdOcrPictureUrl'];
140+
}
141+
if (isset($map['MerchantBizId'])) {
142+
$model->merchantBizId = $map['MerchantBizId'];
143+
}
144+
if (isset($map['MerchantUserId'])) {
145+
$model->merchantUserId = $map['MerchantUserId'];
146+
}
147+
if (isset($map['Ocr'])) {
148+
$model->ocr = $map['Ocr'];
149+
}
150+
if (isset($map['ProductCode'])) {
151+
$model->productCode = $map['ProductCode'];
152+
}
153+
if (isset($map['Spoof'])) {
154+
$model->spoof = $map['Spoof'];
155+
}
156+
157+
return $model;
158+
}
159+
}

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

0 commit comments

Comments
 (0)