1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- // This file is auto-generated, don't edit it. Thanks.
- namespace app\common\controller;
- use AlibabaCloud\SDK\Cloudauth\V20190307\Cloudauth;
- use \Exception;
- use AlibabaCloud\Tea\Exception\TeaError;
- use AlibabaCloud\Tea\Utils\Utils;
- use Darabonba\OpenApi\Models\Config;
- use AlibabaCloud\SDK\Cloudauth\V20190307\Models\InitFaceVerifyRequest;
- use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
- class InitFaceVerify {
- /**
- * 使用AK&SK初始化账号Client
- * @param string $accessKeyId
- * @param string $accessKeySecret
- * @return Cloudauth Client
- */
- public static function createClient($accessKeyId, $accessKeySecret){
- $config = new Config([
- // 必填,您的 AccessKey ID
- "accessKeyId" => $accessKeyId,
- // 必填,您的 AccessKey Secret
- "accessKeySecret" => $accessKeySecret
- ]);
- // Endpoint 请参考 https://api.aliyun.com/product/Cloudauth
- $config->endpoint = "cloudauth.aliyuncs.com";
- return new Cloudauth($config);
- }
- /**
- * @param string[] $args
- * @return void
- */
- public static function main($args){
- $client = self::createClient(getenv("LTAI4GDXpn5FftNNP1SWardn"), getenv('yLU8B0KaiCwmvgbOKtc5XGxk6Kh1IU'));
- // $ReturnUrl = 'http://xiangduilun.hdlkeji.com/app/common/notifyx/type/' . $type.'/orderid/'.$orderId;
- $initFaceVerifyRequest = new InitFaceVerifyRequest([
- 'SceneId'=>1000007515,
- 'OuterOrderNo'=>1,
- 'ProductCode'=>'ID_PRO',
- 'Model'=>'LIVENESS',
- 'CertType'=>'IDENTITY_CARD',
- 'CertName'=>$args['CertName'],//真实姓名
- 'CertNo'=>$args['CertNo'],//证件号码
- 'ReturnUrl'=>$args['ReturnUrl'],
- 'MetaInfo'=>$args['MetaInfo']
- ]);
- $runtime = new RuntimeOptions([]);
- try {
- // 复制代码运行请自行打印 API 的返回值
- $client->initFaceVerifyWithOptions($initFaceVerifyRequest, $runtime);
- }
- catch (Exception $error) {
- if (!($error instanceof TeaError)) {
- $error = new TeaError([], $error->getMessage(), $error->getCode(), $error);
- }
- // 如有需要,请打印 error
- Utils::assertAsString($error->message);
- }
- }
- }
- $path = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
- if (file_exists($path)) {
- require_once $path;
- }
- InitFaceVerify::main(array_slice($argv, 1));
|