预受理领卡请求
商户在引导用户跳转先享卡领卡前,需要请求先享卡预受理领卡请求接口,再根据返回数据引导用户跳转领卡。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
out_card_code | string | 商户领卡号 |
card_template_id | string | 卡模板ID |
appid | string | 公众账号ID |
notify_url | string | 通知商户URL |
php
$instance->v3->discountCard->cards->postAsync([
'json' => [
'out_card_code' => '6e8369071cd942c0476613f9d1ce9ca3',
'card_template_id' => '87789b2f25177433bcbf407e8e471f95',
'appid' => 'wxd678efh567hg6787',
'notify_url' => 'https://api.test.com',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/discount-card/cards')->postAsync([
'json' => [
'out_card_code' => '6e8369071cd942c0476613f9d1ce9ca3',
'card_template_id' => '87789b2f25177433bcbf407e8e471f95',
'appid' => 'wxd678efh567hg6787',
'notify_url' => 'https://api.test.com',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/discount-card/cards']->postAsync([
'json' => [
'out_card_code' => '6e8369071cd942c0476613f9d1ce9ca3',
'card_template_id' => '87789b2f25177433bcbf407e8e471f95',
'appid' => 'wxd678efh567hg6787',
'notify_url' => 'https://api.test.com',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->discountCard->cards->post([
'json' => [
'out_card_code' => '6e8369071cd942c0476613f9d1ce9ca3',
'card_template_id' => '87789b2f25177433bcbf407e8e471f95',
'appid' => 'wxd678efh567hg6787',
'notify_url' => 'https://api.test.com',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/discount-card/cards')->post([
'json' => [
'out_card_code' => '6e8369071cd942c0476613f9d1ce9ca3',
'card_template_id' => '87789b2f25177433bcbf407e8e471f95',
'appid' => 'wxd678efh567hg6787',
'notify_url' => 'https://api.test.com',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/discount-card/cards']->post([
'json' => [
'out_card_code' => '6e8369071cd942c0476613f9d1ce9ca3',
'card_template_id' => '87789b2f25177433bcbf407e8e471f95',
'appid' => 'wxd678efh567hg6787',
'notify_url' => 'https://api.test.com',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
prepare_card_token | string | 预领卡请求token |
参阅 官方文档