Skip to content

同步订单信息

由于收款商户进行的某些“线下操作”会导致微信支付侧的订单状态与实际情况不符。例如,用户通过线下付款的方式已经完成支付,而微信支付侧并未支付成功,此时可能导致用户重复支付。因此商户需要通过订单同步接口将订单状态同步给微信支付,修改订单在微信支付系统中的状态。

请求参数类型描述
out_order_nostring商户服务订单号
jsonobject声明请求的JSON数据结构
service_idstring服务ID
sub_mchidstring子商户号
typestring场景类型
detailobject内容信息详情
seqinteger收款序号
paid_timestring收款成功时间
paid_amountinteger收款金额
php
$instance->v3->payscore->partner->serviceorder->_out_order_no_->sync->postAsync([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'type' => 'Order_Paid',
    'detail' => [
      'seq' => 1,
      'paid_time' => '20091225091210',
      'paid_amount' => 1,
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/payscore/partner/serviceorder/{out_order_no}/sync')->postAsync([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'type' => 'Order_Paid',
    'detail' => [
      'seq' => 1,
      'paid_time' => '20091225091210',
      'paid_amount' => 1,
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/payscore/partner/serviceorder/{out_order_no}/sync']->postAsync([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'type' => 'Order_Paid',
    'detail' => [
      'seq' => 1,
      'paid_time' => '20091225091210',
      'paid_amount' => 1,
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->payscore->partner->serviceorder->_out_order_no_->sync->post([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'type' => 'Order_Paid',
    'detail' => [
      'seq' => 1,
      'paid_time' => '20091225091210',
      'paid_amount' => 1,
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/payscore/partner/serviceorder/{out_order_no}/sync')->post([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'type' => 'Order_Paid',
    'detail' => [
      'seq' => 1,
      'paid_time' => '20091225091210',
      'paid_amount' => 1,
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/payscore/partner/serviceorder/{out_order_no}/sync']->post([
  'out_order_no' => '1234323JKHDFE1243252',
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sub_mchid' => '1900000109',
    'type' => 'Order_Paid',
    'detail' => [
      'seq' => 1,
      'paid_time' => '20091225091210',
      'paid_amount' => 1,
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory