Skip to content

关单

以下情况需要调用关单接口:商户订单支付失败需要生成新单号重新发起支付,要对原订单号调用关单,避免重复支付;系统下单后,用户支付超时,系统退出不再受理,避免用户继续,请调用关单接口。

请求参数类型描述
out_trade_nostring商户订单号
jsonobject声明请求的JSON数据结构
sp_mchidstring服务商户号
sub_mchidstring子商户号
php
$instance->v3->pay->partner->transactions->outTradeNo->_out_trade_no_->close->postAsync([
  'out_trade_no' => '',
  'json' => [
    'sp_mchid'  => '1230000109',
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/pay/partner/transactions/out-trade-no/{out_trade_no}/close')->postAsync([
  'out_trade_no' => '',
  'json' => [
    'sp_mchid'  => '1230000109',
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/pay/partner/transactions/out-trade-no/{out_trade_no}/close']->postAsync([
  'out_trade_no' => '',
  'json' => [
    'sp_mchid'  => '1230000109',
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->pay->partner->transactions->outTradeNo->_out_trade_no_->close->post([
  'out_trade_no' => '',
  'json' => [
    'sp_mchid'  => '1230000109',
    'sub_mchid' => '1900000109',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/pay/partner/transactions/out-trade-no/{out_trade_no}/close')->post([
  'out_trade_no' => '',
  'json' => [
    'sp_mchid'  => '1230000109',
    'sub_mchid' => '1900000109',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/pay/partner/transactions/out-trade-no/{out_trade_no}/close']->post([
  'out_trade_no' => '',
  'json' => [
    'sp_mchid'  => '1230000109',
    'sub_mchid' => '1900000109',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory