Skip to content

撤销订单(商户订单号)

商户可以通过该接口发起撤销订单。

请求参数类型描述
base_uristring声明接入点https://apihk.mch.weixin.qq.com/(香港接入)
out_trade_nostring商户订单号
queryobject声明请求的查询参数
sub_mchidstring子商户号
php
$instance->v3->global->papay->transactions->outTradeNo->_out_trade_no_->reverse->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'out_trade_no' => '1217752501201407033233368018',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/global/papay/transactions/out-trade-no/{out_trade_no}/reverse')->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'out_trade_no' => '1217752501201407033233368018',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/global/papay/transactions/out-trade-no/{out_trade_no}/reverse']->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'out_trade_no' => '1217752501201407033233368018',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->global->papay->transactions->outTradeNo->_out_trade_no_->reverse->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'out_trade_no' => '1217752501201407033233368018',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/global/papay/transactions/out-trade-no/{out_trade_no}/reverse')->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'out_trade_no' => '1217752501201407033233368018',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/global/papay/transactions/out-trade-no/{out_trade_no}/reverse']->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'out_trade_no' => '1217752501201407033233368018',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory