Skip to content

Commit a4e38a0

Browse files
committed
Support API DocOcrMax.
1 parent 00e22c0 commit a4e38a0

File tree

6 files changed

+567
-0
lines changed

6 files changed

+567
-0
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-04-28 Version: 3.6.0
2+
- Support API DocOcrMax.
3+
4+
15
2025-04-24 Version: 3.5.0
26
- Support API CredentialVerifyIntl.
37

src/Cloudauthintl.php

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DeepfakeDetectIntlResponse;
1919
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DeleteVerifyResultRequest;
2020
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DeleteVerifyResultResponse;
21+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DocOcrMaxRequest;
22+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DocOcrMaxResponse;
2123
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DocOcrRequest;
2224
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\DocOcrResponse;
2325
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\EkycVerifyRequest;
@@ -716,6 +718,103 @@ public function docOcr($request)
716718
return $this->docOcrWithOptions($request, $runtime);
717719
}
718720

721+
/**
722+
* 全球证件ocr识别接口.
723+
*
724+
* @param request - DocOcrMaxRequest
725+
* @param runtime - runtime options for this request RuntimeOptions
726+
*
727+
* @returns DocOcrMaxResponse
728+
*
729+
* @param DocOcrMaxRequest $request
730+
* @param RuntimeOptions $runtime
731+
*
732+
* @return DocOcrMaxResponse
733+
*/
734+
public function docOcrMaxWithOptions($request, $runtime)
735+
{
736+
$request->validate();
737+
$body = [];
738+
if (null !== $request->docType) {
739+
@$body['DocType'] = $request->docType;
740+
}
741+
742+
if (null !== $request->idOcrPictureBase64) {
743+
@$body['IdOcrPictureBase64'] = $request->idOcrPictureBase64;
744+
}
745+
746+
if (null !== $request->idOcrPictureUrl) {
747+
@$body['IdOcrPictureUrl'] = $request->idOcrPictureUrl;
748+
}
749+
750+
if (null !== $request->idThreshold) {
751+
@$body['IdThreshold'] = $request->idThreshold;
752+
}
753+
754+
if (null !== $request->merchantBizId) {
755+
@$body['MerchantBizId'] = $request->merchantBizId;
756+
}
757+
758+
if (null !== $request->merchantUserId) {
759+
@$body['MerchantUserId'] = $request->merchantUserId;
760+
}
761+
762+
if (null !== $request->ocrModel) {
763+
@$body['OcrModel'] = $request->ocrModel;
764+
}
765+
766+
if (null !== $request->productCode) {
767+
@$body['ProductCode'] = $request->productCode;
768+
}
769+
770+
if (null !== $request->prompt) {
771+
@$body['Prompt'] = $request->prompt;
772+
}
773+
774+
if (null !== $request->sceneCode) {
775+
@$body['SceneCode'] = $request->sceneCode;
776+
}
777+
778+
if (null !== $request->spoof) {
779+
@$body['Spoof'] = $request->spoof;
780+
}
781+
782+
$req = new OpenApiRequest([
783+
'body' => Utils::parseToMap($body),
784+
]);
785+
$params = new Params([
786+
'action' => 'DocOcrMax',
787+
'version' => '2022-08-09',
788+
'protocol' => 'HTTPS',
789+
'pathname' => '/',
790+
'method' => 'POST',
791+
'authType' => 'AK',
792+
'style' => 'RPC',
793+
'reqBodyType' => 'formData',
794+
'bodyType' => 'json',
795+
]);
796+
797+
return DocOcrMaxResponse::fromMap($this->callApi($params, $req, $runtime));
798+
}
799+
800+
/**
801+
* 全球证件ocr识别接口.
802+
*
803+
* @param request - DocOcrMaxRequest
804+
*
805+
* @returns DocOcrMaxResponse
806+
*
807+
* @param DocOcrMaxRequest $request
808+
*
809+
* @return DocOcrMaxResponse
810+
*/
811+
public function docOcrMax($request)
812+
{
813+
$runtime = new RuntimeOptions([]);
814+
815+
return $this->docOcrMaxWithOptions($request, $runtime);
816+
}
817+
719818
/**
720819
* ekyc纯服务端接口.
721820
*

src/Models/DocOcrMaxRequest.php

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
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\Dara\Model;
8+
9+
class DocOcrMaxRequest extends Model
10+
{
11+
/**
12+
* @var string
13+
*/
14+
public $docType;
15+
16+
/**
17+
* @var string
18+
*/
19+
public $idOcrPictureBase64;
20+
21+
/**
22+
* @var string
23+
*/
24+
public $idOcrPictureUrl;
25+
26+
/**
27+
* @var string
28+
*/
29+
public $idThreshold;
30+
31+
/**
32+
* @var string
33+
*/
34+
public $merchantBizId;
35+
36+
/**
37+
* @var string
38+
*/
39+
public $merchantUserId;
40+
41+
/**
42+
* @var string
43+
*/
44+
public $ocrModel;
45+
46+
/**
47+
* @var string
48+
*/
49+
public $productCode;
50+
51+
/**
52+
* @var string
53+
*/
54+
public $prompt;
55+
56+
/**
57+
* @var string
58+
*/
59+
public $sceneCode;
60+
61+
/**
62+
* @var string
63+
*/
64+
public $spoof;
65+
protected $_name = [
66+
'docType' => 'DocType',
67+
'idOcrPictureBase64' => 'IdOcrPictureBase64',
68+
'idOcrPictureUrl' => 'IdOcrPictureUrl',
69+
'idThreshold' => 'IdThreshold',
70+
'merchantBizId' => 'MerchantBizId',
71+
'merchantUserId' => 'MerchantUserId',
72+
'ocrModel' => 'OcrModel',
73+
'productCode' => 'ProductCode',
74+
'prompt' => 'Prompt',
75+
'sceneCode' => 'SceneCode',
76+
'spoof' => 'Spoof',
77+
];
78+
79+
public function validate()
80+
{
81+
parent::validate();
82+
}
83+
84+
public function toArray($noStream = false)
85+
{
86+
$res = [];
87+
if (null !== $this->docType) {
88+
$res['DocType'] = $this->docType;
89+
}
90+
91+
if (null !== $this->idOcrPictureBase64) {
92+
$res['IdOcrPictureBase64'] = $this->idOcrPictureBase64;
93+
}
94+
95+
if (null !== $this->idOcrPictureUrl) {
96+
$res['IdOcrPictureUrl'] = $this->idOcrPictureUrl;
97+
}
98+
99+
if (null !== $this->idThreshold) {
100+
$res['IdThreshold'] = $this->idThreshold;
101+
}
102+
103+
if (null !== $this->merchantBizId) {
104+
$res['MerchantBizId'] = $this->merchantBizId;
105+
}
106+
107+
if (null !== $this->merchantUserId) {
108+
$res['MerchantUserId'] = $this->merchantUserId;
109+
}
110+
111+
if (null !== $this->ocrModel) {
112+
$res['OcrModel'] = $this->ocrModel;
113+
}
114+
115+
if (null !== $this->productCode) {
116+
$res['ProductCode'] = $this->productCode;
117+
}
118+
119+
if (null !== $this->prompt) {
120+
$res['Prompt'] = $this->prompt;
121+
}
122+
123+
if (null !== $this->sceneCode) {
124+
$res['SceneCode'] = $this->sceneCode;
125+
}
126+
127+
if (null !== $this->spoof) {
128+
$res['Spoof'] = $this->spoof;
129+
}
130+
131+
return $res;
132+
}
133+
134+
public function toMap($noStream = false)
135+
{
136+
return $this->toArray($noStream);
137+
}
138+
139+
public static function fromMap($map = [])
140+
{
141+
$model = new self();
142+
if (isset($map['DocType'])) {
143+
$model->docType = $map['DocType'];
144+
}
145+
146+
if (isset($map['IdOcrPictureBase64'])) {
147+
$model->idOcrPictureBase64 = $map['IdOcrPictureBase64'];
148+
}
149+
150+
if (isset($map['IdOcrPictureUrl'])) {
151+
$model->idOcrPictureUrl = $map['IdOcrPictureUrl'];
152+
}
153+
154+
if (isset($map['IdThreshold'])) {
155+
$model->idThreshold = $map['IdThreshold'];
156+
}
157+
158+
if (isset($map['MerchantBizId'])) {
159+
$model->merchantBizId = $map['MerchantBizId'];
160+
}
161+
162+
if (isset($map['MerchantUserId'])) {
163+
$model->merchantUserId = $map['MerchantUserId'];
164+
}
165+
166+
if (isset($map['OcrModel'])) {
167+
$model->ocrModel = $map['OcrModel'];
168+
}
169+
170+
if (isset($map['ProductCode'])) {
171+
$model->productCode = $map['ProductCode'];
172+
}
173+
174+
if (isset($map['Prompt'])) {
175+
$model->prompt = $map['Prompt'];
176+
}
177+
178+
if (isset($map['SceneCode'])) {
179+
$model->sceneCode = $map['SceneCode'];
180+
}
181+
182+
if (isset($map['Spoof'])) {
183+
$model->spoof = $map['Spoof'];
184+
}
185+
186+
return $model;
187+
}
188+
}

0 commit comments

Comments
 (0)