Skip to content

微工卡核身预下单

服务商在拉起微工卡前端服务给用户做微工卡核身前,需要先调用本接口预下单,下单成功后才能进行核身

请求参数类型描述
jsonobject声明请求的JSON数据结构
openidstring用户标识
appidstring应用ID
sub_mchidstring子商户号
sub_appidstring子商户应用ID
authenticate_numberstring商家核身单号
project_namestring项目名称
employer_namestring单位名称
authenticate_typestring核身类型
SIGN_IN | INSURANCE | CONTRACT 枚举值之一
php
$instance->v3->payrollCard->authentications->preOrder->postAsync([
  'json' => [
    'openid'              => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid'               => 'wxa1111111',
    'sub_mchid'           => '1111111',
    'sub_appid'           => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name'        => '某项目',
    'employer_name'       => '某单位名称',
    'authenticate_type'   => 'SIGN_IN',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payroll-card/authentications/pre-order')->postAsync([
  'json' => [
    'openid'              => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid'               => 'wxa1111111',
    'sub_mchid'           => '1111111',
    'sub_appid'           => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name'        => '某项目',
    'employer_name'       => '某单位名称',
    'authenticate_type'   => 'SIGN_IN',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payroll-card/authentications/pre-order']->postAsync([
  'json' => [
    'openid'              => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid'               => 'wxa1111111',
    'sub_mchid'           => '1111111',
    'sub_appid'           => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name'        => '某项目',
    'employer_name'       => '某单位名称',
    'authenticate_type'   => 'SIGN_IN',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payrollCard->authentications->preOrder->post([
  'json' => [
    'openid'              => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid'               => 'wxa1111111',
    'sub_mchid'           => '1111111',
    'sub_appid'           => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name'        => '某项目',
    'employer_name'       => '某单位名称',
    'authenticate_type'   => 'SIGN_IN',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payroll-card/authentications/pre-order')->post([
  'json' => [
    'openid'              => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid'               => 'wxa1111111',
    'sub_mchid'           => '1111111',
    'sub_appid'           => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name'        => '某项目',
    'employer_name'       => '某单位名称',
    'authenticate_type'   => 'SIGN_IN',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payroll-card/authentications/pre-order']->post([
  'json' => [
    'openid'              => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid'               => 'wxa1111111',
    'sub_mchid'           => '1111111',
    'sub_appid'           => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name'        => '某项目',
    'employer_name'       => '某单位名称',
    'authenticate_type'   => 'SIGN_IN',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
authenticate_numberstring商家核身单号
openidstring用户标识
mchidstring商户号
sub_mchidstring子商户号
tokenstringtoken值
expires_inintegertoken有效时间

参阅 官方文档

Published on the GitHub by TheNorthMemory