Skip to content

创建核销订单

用户完成充值后,合作方必须调用该接口创建核销记录,并确保得到明确应答。 若调用失败,必须间隔一定时间后重试,否则会导致用户在集星光小程序中看到权益的使用状态与实际不符,进而引发用户投诉。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstringappid
wechat_openidstring用户在appid下的唯一标识
qqstring用户QQ账号
right_idstring权益ID
create_timestring权益核销时间
php
$instance->v3->eduStar->orders->postAsync([
  'json' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'right_id'      => 'qw3Da21QRCNt',
    'create_time'   => '2018-05-23T12:13:50+08:00',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/edu-star/orders')->postAsync([
  'json' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'right_id'      => 'qw3Da21QRCNt',
    'create_time'   => '2018-05-23T12:13:50+08:00',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/edu-star/orders']->postAsync([
  'json' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'right_id'      => 'qw3Da21QRCNt',
    'create_time'   => '2018-05-23T12:13:50+08:00',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->eduStar->orders->post([
  'json' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'right_id'      => 'qw3Da21QRCNt',
    'create_time'   => '2018-05-23T12:13:50+08:00',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/edu-star/orders')->post([
  'json' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'right_id'      => 'qw3Da21QRCNt',
    'create_time'   => '2018-05-23T12:13:50+08:00',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/edu-star/orders']->post([
  'json' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'right_id'      => 'qw3Da21QRCNt',
    'create_time'   => '2018-05-23T12:13:50+08:00',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
appidstringappid
wechat_openidstring用户在appid下的唯一标识
qqstring用户QQ账号
right_idstring权益ID
create_timestring权益核销时间
order_statestring订单状态
order_idstring订单号

参阅 官方流程图

通过QQ账号查询核销订单列表

合作方通过调用该接口可获取核销订单信息。

请求参数类型描述
queryobject声明请求的查询参数
appidstringappid
wechat_openidstring用户在appid下的唯一标识
qqstring用户QQ账号
offsetinteger分页页码
limitinteger分页大小
php
$instance->v3->eduStar->orders->getAsync([
  'query' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'offset'        => 0,
    'limit'         => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/edu-star/orders')->getAsync([
  'query' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'offset'        => 0,
    'limit'         => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/edu-star/orders']->getAsync([
  'query' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'offset'        => 0,
    'limit'         => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->eduStar->orders->get([
  'query' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'offset'        => 0,
    'limit'         => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/edu-star/orders')->get([
  'query' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'offset'        => 0,
    'limit'         => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/edu-star/orders']->get([
  'query' => [
    'appid'         => 'wx998877665544wx',
    'wechat_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'qq'            => '',
    'offset'        => 0,
    'limit'         => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
dataobject[]结果集
appidstringappid
wechat_openidstring用户在appid下的唯一标识
qqstring用户QQ账号
right_idstring权益ID
create_timestring权益核销时间
order_statestring订单状态
order_idstring订单号
total_countinteger总数量
offsetinteger分页页码
limitinteger分页大小

参阅 官方流程图

Published on the GitHub by TheNorthMemory