微信支付实名验证
取得token后调用本接口验证微信用户的姓名和身份证信息是否匹配
🔐
本接口服务已于 2021.11.10
(北京时间)停止开放,文档仅做留存参考。
请求参数 | 类型 | 描述 |
---|---|---|
base_uri | string | 声明接入点 固定值 https://fraud.mch.weixin.qq.com/ |
xml | object | 声明请求的XML 数据结构 |
version | string | 接口版本号1.0 | 1.1 枚举值之一 |
mch_id | string | 商户号 |
appid | string | 公众账号ID |
openid | string | 用户标识 |
real_name | string | 真实姓名 |
cred_type | number | 证件类型1 | 2 | 5 | 9 | 12 | 17 | 18 枚举值之一 |
cred_id | string | 证件号码 |
access_token | string | 步骤2或步骤3获取到的access_token |
sign_type | string | 签名类型HMAC-SHA256 | MD5 枚举值之一 |
php
$instance->v2->secsvc->realnameauth->postAsync([
'base_uri' => 'https://fraud.mch.weixin.qq.com/', // 接入点
'xml' => [
'version' => '1.0',
'mch_id' => '1900000109',
'appid' => 'wx2421b1c4370ec43b',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'real_name' => '刘某某',
'cred_type' => '1',
'cred_id' => '440000000000000000',
'access_token' => '81_...',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/secsvc/realnameauth')->postAsync([
'base_uri' => 'https://fraud.mch.weixin.qq.com/', // 接入点
'xml' => [
'version' => '1.0',
'mch_id' => '1900000109',
'appid' => 'wx2421b1c4370ec43b',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'real_name' => '刘某某',
'cred_type' => '1',
'cred_id' => '440000000000000000',
'access_token' => '81_...',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/secsvc/realnameauth']->postAsync([
'base_uri' => 'https://fraud.mch.weixin.qq.com/', // 接入点
'xml' => [
'version' => '1.0',
'mch_id' => '1900000109',
'appid' => 'wx2421b1c4370ec43b',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'real_name' => '刘某某',
'cred_type' => '1',
'cred_id' => '440000000000000000',
'access_token' => '81_...',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->secsvc->realnameauth->post([
'base_uri' => 'https://fraud.mch.weixin.qq.com/', // 接入点
'xml' => [
'version' => '1.0',
'mch_id' => '1900000109',
'appid' => 'wx2421b1c4370ec43b',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'real_name' => '刘某某',
'cred_type' => '1',
'cred_id' => '440000000000000000',
'access_token' => '81_...',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/secsvc/realnameauth')->post([
'base_uri' => 'https://fraud.mch.weixin.qq.com/', // 接入点
'xml' => [
'version' => '1.0',
'mch_id' => '1900000109',
'appid' => 'wx2421b1c4370ec43b',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'real_name' => '刘某某',
'cred_type' => '1',
'cred_id' => '440000000000000000',
'access_token' => '81_...',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/secsvc/realnameauth']->post([
'base_uri' => 'https://fraud.mch.weixin.qq.com/', // 接入点
'xml' => [
'version' => '1.0',
'mch_id' => '1900000109',
'appid' => 'wx2421b1c4370ec43b',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'real_name' => '刘某某',
'cred_type' => '1',
'cred_id' => '440000000000000000',
'access_token' => '81_...',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 错误码描述 |
error_code | string | 错误码 |
error_code_des | string | 错误代码描述 |
sign | string | 签名 |
result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 |
appid | string | 公众账号ID |
mch_id | string | 商户号 |
nonce_str | string | 随机字符串 |
openid | string | 用户标识 |
access_token | string | 步骤2或步骤3获取到的access_token |
verify_openid | string | 有多个结果时用分号”;”连接V_OP_NA | V_OP_NM_MA | V_OP_NM_UM 枚举值之一 |
verify_real_name | string | 当verify_openid为V_OP_NM_MA时返回V_NM_ID_MA | V_NM_ID_UM | V_NM_ID_TYPE_UM 枚举值之一 |
bind_bankcard | string | 当verify_real_name为V_NM_ID_MA时返回YES | NO 枚举值之一 |
参阅 官方文档