微工卡核身预下单
服务商在拉起微工卡前端服务给用户做微工卡核身前,需要先调用本接口预下单,下单成功后才能进行核身
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
openid | string | 用户标识 |
appid | string | 应用ID |
sub_mchid | string | 子商户号 |
sub_appid | string | 子商户应用ID |
authenticate_number | string | 商家核身单号 |
project_name | string | 项目名称 |
employer_name | string | 单位名称 |
authenticate_type | string | 核身类型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_number | string | 商家核身单号 |
openid | string | 用户标识 |
mchid | string | 商户号 |
sub_mchid | string | 子商户号 |
token | string | token值 |
expires_in | integer | token有效时间 |
参阅 官方文档