Skip to content

预受理领卡请求

商户在引导用户跳转先享卡领卡前,需要请求先享卡预受理领卡请求接口,再根据返回数据引导用户跳转领卡。

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_card_codestring商户领卡号
card_template_idstring卡模板ID
appidstring公众账号ID
notify_urlstring通知商户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_tokenstring预领卡请求token

参阅 官方文档

Published on the GitHub by TheNorthMemory