$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));