Skip to content

实名信息校验

电商订单实名校验。

请求参数类型描述
queryobject声明请求的查询参数
credential_typenumber下单用户账户的证件类型
1 | 2 | 5 | 9 | 12 | 17 | 19 枚举值之一
encrypted_credential_idstring加密后的下单用户证件号
encrypted_namestring加密后的下单用户姓名
wxp_trade_nostring微信支付交易单号
headersobject声明请求的头参数
Wechatpay-Serialstring微信支付公钥ID/平台证书序列号
php
$instance->v3->realname->verify->getAsync([
  'query' => [
    'credential_type'         => 1,
    'encrypted_credential_id' => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'encrypted_name'          => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'wxp_trade_no'            => '442100010320250122523549415021',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/realname/verify')->getAsync([
  'query' => [
    'credential_type'         => 1,
    'encrypted_credential_id' => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'encrypted_name'          => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'wxp_trade_no'            => '442100010320250122523549415021',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/realname/verify']->getAsync([
  'query' => [
    'credential_type'         => 1,
    'encrypted_credential_id' => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'encrypted_name'          => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'wxp_trade_no'            => '442100010320250122523549415021',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->realname->verify->get([
  'query' => [
    'credential_type'         => 1,
    'encrypted_credential_id' => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'encrypted_name'          => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'wxp_trade_no'            => '442100010320250122523549415021',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/realname/verify')->get([
  'query' => [
    'credential_type'         => 1,
    'encrypted_credential_id' => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'encrypted_name'          => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'wxp_trade_no'            => '442100010320250122523549415021',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/realname/verify']->get([
  'query' => [
    'credential_type'         => 1,
    'encrypted_credential_id' => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'encrypted_name'          => 'InhziTSUwVqxfKp9M5nGCSjF395VL',
    'wxp_trade_no'            => '442100010320250122523549415021',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
verify_resultnumber实名比对结果
0 | 1 枚举值之一
err_messagestring错误信息

参阅 官方文档

Published on the GitHub by TheNorthMemory