承接 liuyexing/aliyun-contrast-face-verify 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

liuyexing/aliyun-contrast-face-verify

最新稳定版本:1.0.1

Composer 安装命令:

composer require liuyexing/aliyun-contrast-face-verify

包简介

阿里云金融级实人认证

README 文档

README

阿里云金融级实人认证

使用示例:
use AliyunFinancialGradeIdVerification\ContrastFaceVerify;
class Test{
    private $accessKeyId = '';//阿里云key
    private $accessKeySecret = '';//阿里云秘钥
    private $sceneId = ''; //认证场景ID
    
    /**
     * 初始化
     */
    public function __construct($config=[])
    {
        $this->accessKeyId=$config['accessKeyId'];
        $this->accessKeySecret=$config['accessKeySecret'];
        $this->sceneId=$config['sceneId'];
        $this->callbackUrl=$config['callbackUrl'];
    }

    /**
     * 获取CertifyId参数
     */
    public function getCertifyId()
    {
        try{
           $config=[
                'accessKeyId'=>self::$accessKeyId,
                'accessKeySecret'=>self::$accessKeySecret,
                'sceneId'=>self::$sceneId,
                'callbackUrl'=>'https://www.xxx.com/test/callback'
            ];
            $aliyun=new ContrastFaceVerify($config);
            $realname='真实姓名';
            $idcard='身份证号';
            $certifyId=$aliyun->getCertifyId($param['meta_info'],$realname,$idcard);
        }catch(\Exception){
            die($e->getMessage());
        }
        return $certifyId;
    }
    
    /**
     * 处理验证回调
     */
    public function callback()
    {
         $param = $this->request->param();
         $certifyId = $param['certifyId'];
        try{
            $config=[
                'accessKeyId'=>self::$accessKeyId,
                'accessKeySecret'=>self::$accessKeySecret,
                'sceneId'=>self::$sceneId,
                'callbackUrl'=>$this->request->domain().'/api/Alibaba/callback'
            ];
            $aliyun=new ContrastFaceVerify($config);
            $res=$aliyun->callbackVerify($certifyId);
            if($res){
               //处理成功逻辑
            }else{
                //处理失败逻辑
            }
        }catch(\Exception){
            die($e->getMessage());
        }
    }

}





统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-23