交易保障 
商户在调用微信支付提供的相关接口时,会得到微信支付返回的相关信息以及获得整个接口的响应时间。为提高整体的服务水平,协助商户一起提高服务质量,微信支付提供了相关接口调用耗时和返回信息的主动上报接口,微信支付可以根据商户侧上报的数据进一步优化网络部署,完善服务监控,和商户更好的协作为用户提供更好的业务体验。
| 请求参数 | 类型 | 描述 | 
|---|---|---|
| xml | object | 声明请求的XML数据结构 | 
| appid | string | 公众账号ID | 
| mch_id | string | 商户号 | 
| device_info | string | 设备号 | 
| interface_url | string | 接口URL | 
| user_ip | string | 访问接口IP | 
| trades | string | 上报数据包JSON格式字符串 | 
| transaction | object[] | 交易数据 | 
| out_trade_no | string | 商户订单号 | 
| begin_time | string | 交易开始时间(扫码时间) | 
| end_time | string | 交易完成时间 | 
| state | string | 交易结果OK | FAIL | CANCLE 枚举值之一 | 
| err_msg | string | 自定义的错误描述信息 | 
php
$instance->v2->payitil->report->postAsync([
  'xml' => [
    'appid'         => 'wx8888888888888888',
    'mch_id'        => '1900000109',
    'device_info'   => '013467007045764',
    'interface_url' => 'https://api.mch.weixin.qq.com/pay/batchreport/micropay/total',
    'user_ip'       => '8.8.8.8',
    'trades'        => \json_encode([[
      'out_trade_no' => 'out_trade_no_test_1',
      'begin_time'   => '20160602203256',
      'end_time'     => '20160602203257',
      'state'        => 'OK',
      'err_msg'      => '',
    ],]),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$instance->chain('v2/payitil/report')->postAsync([
  'xml' => [
    'appid'         => 'wx8888888888888888',
    'mch_id'        => '1900000109',
    'device_info'   => '013467007045764',
    'interface_url' => 'https://api.mch.weixin.qq.com/pay/batchreport/micropay/total',
    'user_ip'       => '8.8.8.8',
    'trades'        => \json_encode([[
      'out_trade_no' => 'out_trade_no_test_1',
      'begin_time'   => '20160602203256',
      'end_time'     => '20160602203257',
      'state'        => 'OK',
      'err_msg'      => '',
    ],]),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$instance['v2/payitil/report']->postAsync([
  'xml' => [
    'appid'         => 'wx8888888888888888',
    'mch_id'        => '1900000109',
    'device_info'   => '013467007045764',
    'interface_url' => 'https://api.mch.weixin.qq.com/pay/batchreport/micropay/total',
    'user_ip'       => '8.8.8.8',
    'trades'        => \json_encode([[
      'out_trade_no' => 'out_trade_no_test_1',
      'begin_time'   => '20160602203256',
      'end_time'     => '20160602203257',
      'state'        => 'OK',
      'err_msg'      => '',
    ],]),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$response = $instance->v2->payitil->report->post([
  'xml' => [
    'appid'         => 'wx8888888888888888',
    'mch_id'        => '1900000109',
    'device_info'   => '013467007045764',
    'interface_url' => 'https://api.mch.weixin.qq.com/pay/batchreport/micropay/total',
    'user_ip'       => '8.8.8.8',
    'trades'        => \json_encode([[
      'out_trade_no' => 'out_trade_no_test_1',
      'begin_time'   => '20160602203256',
      'end_time'     => '20160602203257',
      'state'        => 'OK',
      'err_msg'      => '',
    ],]),
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));php
$response = $instance->chain('v2/payitil/report')->post([
  'xml' => [
    'appid'         => 'wx8888888888888888',
    'mch_id'        => '1900000109',
    'device_info'   => '013467007045764',
    'interface_url' => 'https://api.mch.weixin.qq.com/pay/batchreport/micropay/total',
    'user_ip'       => '8.8.8.8',
    'trades'        => \json_encode([[
      'out_trade_no' => 'out_trade_no_test_1',
      'begin_time'   => '20160602203256',
      'end_time'     => '20160602203257',
      'state'        => 'OK',
      'err_msg'      => '',
    ],]),
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));php
$response = $instance['v2/payitil/report']->post([
  'xml' => [
    'appid'         => 'wx8888888888888888',
    'mch_id'        => '1900000109',
    'device_info'   => '013467007045764',
    'interface_url' => 'https://api.mch.weixin.qq.com/pay/batchreport/micropay/total',
    'user_ip'       => '8.8.8.8',
    'trades'        => \json_encode([[
      'out_trade_no' => 'out_trade_no_test_1',
      'begin_time'   => '20160602203256',
      'end_time'     => '20160602203257',
      'state'        => 'OK',
      'err_msg'      => '',
    ],]),
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));| 返回字典 | 类型 | 描述 | 
|---|---|---|
| return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 | 
| return_msg | string | 返回信息 | 
| result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 | 
参阅 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档