Skip to content

校验核身结果

校验按商户拉起核身时预下单的token值对应的微工卡核身结果是否成功

请求参数类型描述
jsonobject声明请求的JSON数据结构
sp_mchidstring服务商商户号
sub_mchidstring特约商户商户号
tokenstringtoken值
user_namestring用户姓名
id_card_numberstring用户身份证号
authenticate_typestring核身类型
NORMAL | SIGN_IN | INSURANCE | CONTRACT 枚举值之一
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->payrollCard->wesure->tokenValidations->postAsync([
  'json' => [
    'sp_mchid'          => '1900000109',
    'sub_mchid'         => '1900000109',
    'token'             => 'abcdefghijklmn',
    'user_name'         => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number'    => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'authenticate_type' => 'NORMAL',
  ],
  '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/payroll-card/wesure/token-validations')->postAsync([
  'json' => [
    'sp_mchid'          => '1900000109',
    'sub_mchid'         => '1900000109',
    'token'             => 'abcdefghijklmn',
    'user_name'         => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number'    => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'authenticate_type' => 'NORMAL',
  ],
  '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/payroll-card/wesure/token-validations']->postAsync([
  'json' => [
    'sp_mchid'          => '1900000109',
    'sub_mchid'         => '1900000109',
    'token'             => 'abcdefghijklmn',
    'user_name'         => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number'    => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'authenticate_type' => 'NORMAL',
  ],
  '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->payrollCard->wesure->tokenValidations->post([
  'json' => [
    'sp_mchid'          => '1900000109',
    'sub_mchid'         => '1900000109',
    'token'             => 'abcdefghijklmn',
    'user_name'         => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number'    => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'authenticate_type' => 'NORMAL',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payroll-card/wesure/token-validations')->post([
  'json' => [
    'sp_mchid'          => '1900000109',
    'sub_mchid'         => '1900000109',
    'token'             => 'abcdefghijklmn',
    'user_name'         => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number'    => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'authenticate_type' => 'NORMAL',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payroll-card/wesure/token-validations']->post([
  'json' => [
    'sp_mchid'          => '1900000109',
    'sub_mchid'         => '1900000109',
    'token'             => 'abcdefghijklmn',
    'user_name'         => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number'    => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'authenticate_type' => 'NORMAL',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
resultstring校验结果
authenticate_success_timestring核身成功时间
openidstring用户标识
fail_reasonstring校验不通过原因

参阅 官方文档

Published on the GitHub by TheNorthMemory