1. 程式人生 > 實用技巧 >騰訊雲 銀行卡四要素核驗 tp

騰訊雲 銀行卡四要素核驗 tp

騰訊雲地址:https://cloud.tencent.com/document/product/1007/35775

方法:sdkhttps://github.com/TencentCloud/tencentcloud-sdk-php安裝sdk

tp 引入

require_once 'vendor/autoload.php';

use TencentCloud\Common\Credential;

use TencentCloud\Common\Profile\ClientProfile;

use TencentCloud\Common\Profile\HttpProfile;

use TencentCloud\Common\Exception\TencentCloudSDKException;

use TencentCloud\Faceid\V20180301\FaceidClient;

use TencentCloud\Faceid\V20180301\Models\BankCard4EVerificationRequest;

function check_bank_info($backinfo)
{
try {
$cred = new Credential("SecretId", "SecretKey");
$httpProfile = new HttpProfile();
$httpProfile->setEndpoint("faceid.tencentcloudapi.com");


$clientProfile = new ClientProfile();
$clientProfile->setHttpProfile($httpProfile);
$client = new FaceidClient($cred, "ap-beijing", $clientProfile);

$req = new BankCard4EVerificationRequest();

$params = array(
"Name" => '張先生',
"BankCard" => '123456',

"Phone" => '13581766382',
"IdCard" => '身份證號',
"CertType" => 0
);
$req->fromJsonString(json_encode($params));
$resp = $client->BankCard4EVerification($req);
$result = $resp->toJsonString();
return $result['Result'];
//print_r($resp->toJsonString());
}
catch(TencentCloudSDKException $e) {
echo $e;
}
}