Skip to content

取消支付分订单

微信支付分订单创建之后,由于某些原因导致订单不能正常支付时,可使用此接口取消订单。前置条件:服务订单状态为已创单或进行中

请求参数类型描述
out_order_nostring商户服务订单号
jsonobject声明请求的JSON数据结构
appidstring公众账号ID
service_idstring服务ID
reasonstring取消原因
php
$instance->v3->payscore->serviceorder->_out_order_no_->cancel->postAsync([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'reason' => '用户投诉',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/serviceorder/{out_order_no}/cancel')->postAsync([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'reason' => '用户投诉',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/serviceorder/{out_order_no}/cancel']->postAsync([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'reason' => '用户投诉',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->serviceorder->_out_order_no_->cancel->post([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'reason' => '用户投诉',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/serviceorder/{out_order_no}/cancel')->post([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'reason' => '用户投诉',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/serviceorder/{out_order_no}/cancel']->post([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'reason' => '用户投诉',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
appidstring公众账号ID
mchidstring商户号
out_order_nostring商户服务订单号
service_idstring服务ID
order_idstring微信支付服务订单号

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory