查询退款
注意:如果单个支付订单部分退款次数超过20次请使用退款单号查询
| 请求参数 | 类型 | 描述 |
|---|---|---|
| xml | object | 声明请求的XML数据结构 |
| appid | string | 公众账号ID |
| mch_id | string | 商户号 |
| sub_appid | string | 子商户公众账号ID |
| sub_mch_id | string | 子商户号 |
| sign_type | string | 签名类型MD5 | HMAC-SHA256 枚举值之一 |
| transaction_id | string | 微信订单号 |
| out_trade_no | string | 商户订单号 |
| out_refund_no | string | 商户退款单号 |
| refund_id | string | 微信退款单号 |
| offset | integer | 偏移量 |
php
$instance->v2->pay->refundquery->postAsync([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sub_appid' => 'wx8888888888888888',
'sub_mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'transaction_id' => '1217752501201407033233368018',
'out_trade_no' => '1217752501201407033233368018',
'out_refund_no' => '1217752501201407033233368018',
'refund_id' => '1217752501201407033233368018',
'offset' => '15',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$instance->chain('v2/pay/refundquery')->postAsync([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sub_appid' => 'wx8888888888888888',
'sub_mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'transaction_id' => '1217752501201407033233368018',
'out_trade_no' => '1217752501201407033233368018',
'out_refund_no' => '1217752501201407033233368018',
'refund_id' => '1217752501201407033233368018',
'offset' => '15',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$instance['v2/pay/refundquery']->postAsync([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sub_appid' => 'wx8888888888888888',
'sub_mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'transaction_id' => '1217752501201407033233368018',
'out_trade_no' => '1217752501201407033233368018',
'out_refund_no' => '1217752501201407033233368018',
'refund_id' => '1217752501201407033233368018',
'offset' => '15',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$response = $instance->v2->pay->refundquery->post([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sub_appid' => 'wx8888888888888888',
'sub_mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'transaction_id' => '1217752501201407033233368018',
'out_trade_no' => '1217752501201407033233368018',
'out_refund_no' => '1217752501201407033233368018',
'refund_id' => '1217752501201407033233368018',
'offset' => '15',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));php
$response = $instance->chain('v2/pay/refundquery')->post([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sub_appid' => 'wx8888888888888888',
'sub_mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'transaction_id' => '1217752501201407033233368018',
'out_trade_no' => '1217752501201407033233368018',
'out_refund_no' => '1217752501201407033233368018',
'refund_id' => '1217752501201407033233368018',
'offset' => '15',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));php
$response = $instance['v2/pay/refundquery']->post([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sub_appid' => 'wx8888888888888888',
'sub_mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'transaction_id' => '1217752501201407033233368018',
'out_trade_no' => '1217752501201407033233368018',
'out_refund_no' => '1217752501201407033233368018',
'refund_id' => '1217752501201407033233368018',
'offset' => '15',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));| 返回字典 | 类型 | 描述 |
|---|---|---|
| return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
| return_msg | string | 返回信息 |
| result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 |
| err_code | string | 错误码 |
| err_code_des | string | 错误描述 |
| appid | string | 公众账号ID |
| mch_id | string | 商户号 |
| sub_appid | string | 子商户公众账号ID |
| sub_mch_id | string | 子商户号 |
| nonce_str | string | 随机字符串 |
| sign | string | 签名 |
| total_refund_count | integer | 订单总退款次数 |
| transaction_id | string | 微信订单号 |
| out_trade_no | string | 商户订单号 |
| total_fee | integer | 订单金额 |
| settlement_total_fee | integer | 应结订单金额 |
| fee_type | string | 货币种类 |
| cash_fee | integer | 现金支付金额 |
| refund_count | integer | 退款笔数 |
| out_refund_no_$n | string | 商户退款单号 |
| refund_id_$n | string | 微信退款单号 |
| refund_channel_$n | string | 退款渠道 |
| refund_fee_$n | integer | 申请退款金额 |
| settlement_refund_fee_$n | integer | 退款金额 |
| coupon_type_$n_$m | string | 代金券类型 |
| coupon_refund_fee_$n | integer | 总代金券退款金额 |
| coupon_refund_count_$n | integer | 退款代金券使用数量 |
| coupon_refund_id_$n_$m | string | 退款代金券ID |
| coupon_refund_fee_$n_$m | integer | 单个代金券退款金额 |
| refund_status_$n | string | 退款状态 |
| refund_account_$n | string | 退款资金来源 |
| refund_recv_accout_$n | string | 退款入账账户 |
| refund_success_time_$n | string | 退款成功时间 |
参阅 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档