Skip to content

支付结果页展示会员积分

商户调此接口,可以给用户每笔订单支付结果页展示本次订单会员积分变更信息

请求参数类型描述
card_idstring会员卡模板id
codestring会员卡code
jsonobject声明请求的JSON数据结构
out_trade_nostring商户订单号
mchidstring直连商户号
sub_mchidstring子商户号
bonus_valueinteger会员积分值
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->bonus->prepare->postAsync([
  'card_id' => '478515832665',
  'code' => '478515832665',
  'json' => [
    'out_trade_no' => '1217752501201407033233368018',
    'mchid'        => '1230000109',
    'sub_mchid'    => '1900000109',
    'bonus_value'  => 30,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}/bonus/prepare')->postAsync([
  'card_id' => '478515832665',
  'code' => '478515832665',
  'json' => [
    'out_trade_no' => '1217752501201407033233368018',
    'mchid'        => '1230000109',
    'sub_mchid'    => '1900000109',
    'bonus_value'  => 30,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}/bonus/prepare']->postAsync([
  'card_id' => '478515832665',
  'code' => '478515832665',
  'json' => [
    'out_trade_no' => '1217752501201407033233368018',
    'mchid'        => '1230000109',
    'sub_mchid'    => '1900000109',
    'bonus_value'  => 30,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->bonus->prepare->post([
  'card_id' => '478515832665',
  'code' => '478515832665',
  'json' => [
    'out_trade_no' => '1217752501201407033233368018',
    'mchid'        => '1230000109',
    'sub_mchid'    => '1900000109',
    'bonus_value'  => 30,
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}/bonus/prepare')->post([
  'card_id' => '478515832665',
  'code' => '478515832665',
  'json' => [
    'out_trade_no' => '1217752501201407033233368018',
    'mchid'        => '1230000109',
    'sub_mchid'    => '1900000109',
    'bonus_value'  => 30,
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}/bonus/prepare']->post([
  'card_id' => '478515832665',
  'code' => '478515832665',
  'json' => [
    'out_trade_no' => '1217752501201407033233368018',
    'mchid'        => '1230000109',
    'sub_mchid'    => '1900000109',
    'bonus_value'  => 30,
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory