交易保障
商户在调用微信支付提供的相关接口时,会得到微信支付返回的相关信息以及获得整个接口的响应时间。为提高整体的服务水平,协助商户一起提高服务质量,微信支付提供了相关接口调用耗时和返回信息的主动上报接口,微信支付可以根据商户侧上报的数据进一步优化网络部署,完善服务监控,和商户更好的协作为用户提供更好的业务体验。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
appid | string | 公众账号ID |
mch_id | string | 商户号 |
device_info | string | 设备号 |
interface_url | string | 接口URL |
user_ip | string | 访问接口IP |
trades | 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' => '',
],
])
->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' => '',
],
])
->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' => '',
],
])
->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' => '',
],
]);
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' => '',
],
]);
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' => '',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码 |
return_msg | string | 返回信息 |
result_code | string | 业务结果 |