获取抬头填写链接
非微信支付场景中,商户需先调用本接口获取抬头填写链接,供用户填写发票抬头。当用户提交抬头信息后,微信支付会根据商户配置的回调地址进行回调通知。 注意:获取到的抬头填写链接有30分钟的有效期,若在用户填写发票抬头之前链接过期,商户需要重新获取(此时无需更换发票申请单号)
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
sub_mchid | string | 子商户号 |
fapiao_apply_id | string | 发票申请单号 |
source | string | 开票来源 |
appid | string | 商户AppID |
openid | string | 用户OpenID |
total_amount | integer | 总金额 |
seller_name | string | 销售方名称 |
show_phone_cell | boolean | 是否需要展示手机号填写栏 |
must_input_phone | boolean | 用户是否必须填写手机号 |
show_email_cell | boolean | 是否需要展示邮箱地址填写栏 |
must_input_email | boolean | 用户是否必须填写邮箱地址 |
php
$instance->v3->newTaxControlFapiao->userTitle->titleUrl->getAsync([
'query' => [
'sub_mchid' => '1900000109',
'fapiao_apply_id' => 'fapiao_20200701_123456',
'source' => 'WEB',
'appid' => 'wxb1170446a4c0a5a2',
'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
'total_amount' => 382895,
'seller_name' => '深圳市南山区测试商户',
'show_phone_cell' => true,
'must_input_phone' => true,
'show_email_cell' => true,
'must_input_email' => true,
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/new-tax-control-fapiao/user-title/title-url')->getAsync([
'query' => [
'sub_mchid' => '1900000109',
'fapiao_apply_id' => 'fapiao_20200701_123456',
'source' => 'WEB',
'appid' => 'wxb1170446a4c0a5a2',
'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
'total_amount' => 382895,
'seller_name' => '深圳市南山区测试商户',
'show_phone_cell' => true,
'must_input_phone' => true,
'show_email_cell' => true,
'must_input_email' => true,
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/new-tax-control-fapiao/user-title/title-url']->getAsync([
'query' => [
'sub_mchid' => '1900000109',
'fapiao_apply_id' => 'fapiao_20200701_123456',
'source' => 'WEB',
'appid' => 'wxb1170446a4c0a5a2',
'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
'total_amount' => 382895,
'seller_name' => '深圳市南山区测试商户',
'show_phone_cell' => true,
'must_input_phone' => true,
'show_email_cell' => true,
'must_input_email' => true,
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->newTaxControlFapiao->userTitle->titleUrl->get([
'query' => [
'sub_mchid' => '1900000109',
'fapiao_apply_id' => 'fapiao_20200701_123456',
'source' => 'WEB',
'appid' => 'wxb1170446a4c0a5a2',
'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
'total_amount' => 382895,
'seller_name' => '深圳市南山区测试商户',
'show_phone_cell' => true,
'must_input_phone' => true,
'show_email_cell' => true,
'must_input_email' => true,
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/new-tax-control-fapiao/user-title/title-url')->get([
'query' => [
'sub_mchid' => '1900000109',
'fapiao_apply_id' => 'fapiao_20200701_123456',
'source' => 'WEB',
'appid' => 'wxb1170446a4c0a5a2',
'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
'total_amount' => 382895,
'seller_name' => '深圳市南山区测试商户',
'show_phone_cell' => true,
'must_input_phone' => true,
'show_email_cell' => true,
'must_input_email' => true,
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/new-tax-control-fapiao/user-title/title-url']->get([
'query' => [
'sub_mchid' => '1900000109',
'fapiao_apply_id' => 'fapiao_20200701_123456',
'source' => 'WEB',
'appid' => 'wxb1170446a4c0a5a2',
'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
'total_amount' => 382895,
'seller_name' => '深圳市南山区测试商户',
'show_phone_cell' => true,
'must_input_phone' => true,
'show_email_cell' => true,
'must_input_email' => true,
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
title_url | string | 抬头填写链接 |
miniprogram_appid | string | 抬头填写小程序AppID |
miniprogram_path | string | 抬头填写小程序页面路径 |
miniprogram_user_name | string | 抬头填写小程序的用户名 |
参阅 官方文档