Skip to content

支付分订单同步

由于收款商户进行的某些“线下操作”会导致微信支付侧的订单状态与实际情况不符,例如用户通过线下付款的方式已经完成了支付,而微信支付侧还没有支付成功,此时可能导致用户重复支付。因此商户需要通过订单同步接口将订单状态同步给微信支付,修改订单在微信支付系统中的状态。 **注意:** 本接口只适用于智慧零售、先享后付、免押租借、免押速住的免押订单。

请求参数类型描述
out_order_nostring商户服务订单号
jsonobject声明请求的JSON数据结构
appidstring公众账号ID
service_idstring服务ID
typestring场景类型
Order_Paid 枚举值
detailobject
paid_timestring
php
$instance->v3->payscore->payafterOrders->_out_order_no_->sync->postAsync([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'type' => 'Order_Paid',
    'detail' => [
      'paid_time' => '20091225091010',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/payafter-orders/{out_order_no}/sync')->postAsync([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'type' => 'Order_Paid',
    'detail' => [
      'paid_time' => '20091225091010',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/payafter-orders/{out_order_no}/sync']->postAsync([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'type' => 'Order_Paid',
    'detail' => [
      'paid_time' => '20091225091010',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->payafterOrders->_out_order_no_->sync->post([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'type' => 'Order_Paid',
    'detail' => [
      'paid_time' => '20091225091010',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/payafter-orders/{out_order_no}/sync')->post([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'type' => 'Order_Paid',
    'detail' => [
      'paid_time' => '20091225091010',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/payafter-orders/{out_order_no}/sync']->post([
  'out_order_no' => '',
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'type' => 'Order_Paid',
    'detail' => [
      'paid_time' => '20091225091010',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
appidstring公众账号ID
mchidstring商户号
out_order_nostring商户服务订单号
order_idstring微信支付服务订单号

参阅 官方文档

Published on the GitHub by TheNorthMemory