腾讯云 银行卡四要素核验 tp

腾讯云地址:https://cloud.tencent.com/document/product/1007/35775

方法:sdk https://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;
}
}
posted @ 2020-09-01 15:41  zda龙  阅读(455)  评论(0编辑  收藏  举报