а√在线中文网新版地址在线,播五月开心婷婷综合,午夜国产精品视频在线,√8天堂资源地址中文在线,80岁色老头oldmanvideos

注冊送短信

DEMO: Factor/idcard_faceauthentic - 人口庫人像對比



<?php

/*****************
 * 加密請求 示例代碼
 ******************/
//appid參數(shù) appkey參數(shù)在     身份認(rèn)證-創(chuàng)建/管理AppID中獲取
$appid      = '6***3';                                                                  //appid參數(shù)
$appkey     = '5d****************************58';                                       //appkey參數(shù)
$timestamp  = time();                                                                   //獲取當(dāng)前時間戳
$name       = '***';                                                                    //待驗證用戶姓名
$idNo       = '3****************3';                                                     //待驗證用戶 身份證號碼
$image      = '/Users/v1ctor/Documents/圖片/****.jpg';                                   //圖片地址

$temp_data = array(
    'appkey'    => $appkey ,
    'timestamp' => $timestamp,
    'idNo'      => $idNo,
    'name'      => $name,
);

//生成簽名
ksort($temp_data);
reset($temp_data);
$signature = hash('sha256', http_build_query($temp_data));

$post_data = array(
    'appid'     => $appid,
    'timestamp' => $timestamp,
    'signature' => $signature,
    'name'      => $name,
    'idNo'      => $idNo,
    'image'     => curl_file_create($image),
);

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL             => "https://tpa.mysubmail.com/factor/idcard_faceauthentic",
    CURLOPT_RETURNTRANSFER  => true,
    CURLOPT_CUSTOMREQUEST   => "POST",
    CURLOPT_POSTFIELDS      => $post_data,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}