Skip to content

修改订单金额

完结订单总金额与实际金额不符时,且当服务订单收款状态处于“待支付(USER_PAYING)”时,商户可通过该接口修改订单金额。

请求参数类型描述
out_order_nostring商户服务订单号
jsonobject声明请求的JSON数据结构
service_idstring服务ID
sub_mchidstring子商户号
post_paymentsobject[]后付费项目
namestring付费名称
descriptionstring付费说明
amountinteger付费金额
countinteger付费数量
post_discountsobject[]后付费商户优惠
namestring优惠名称
descriptionstring优惠说明
amountinteger优惠金额
countinteger优惠数量
total_amountinteger总金额
reasonstring修改原因
php
$instance->v3->payscore->partner->serviceorder->_out_order_no_->modify->postAsync([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'post_payments' => [[
      'name' => '就餐费用',
      'description' => '就餐人均100元',
      'amount' => 40000,
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'total_amount' => 50000,
    'reason' => '用户投诉',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/payscore/partner/serviceorder/{out_order_no}/modify')->postAsync([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'post_payments' => [[
      'name' => '就餐费用',
      'description' => '就餐人均100元',
      'amount' => 40000,
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'total_amount' => 50000,
    'reason' => '用户投诉',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/payscore/partner/serviceorder/{out_order_no}/modify']->postAsync([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'post_payments' => [[
      'name' => '就餐费用',
      'description' => '就餐人均100元',
      'amount' => 40000,
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'total_amount' => 50000,
    'reason' => '用户投诉',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->payscore->partner->serviceorder->_out_order_no_->modify->post([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'post_payments' => [[
      'name' => '就餐费用',
      'description' => '就餐人均100元',
      'amount' => 40000,
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'total_amount' => 50000,
    'reason' => '用户投诉',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/payscore/partner/serviceorder/{out_order_no}/modify')->post([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'post_payments' => [[
      'name' => '就餐费用',
      'description' => '就餐人均100元',
      'amount' => 40000,
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'total_amount' => 50000,
    'reason' => '用户投诉',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/payscore/partner/serviceorder/{out_order_no}/modify']->post([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'post_payments' => [[
      'name' => '就餐费用',
      'description' => '就餐人均100元',
      'amount' => 40000,
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'total_amount' => 50000,
    'reason' => '用户投诉',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory