查询退款(支持单品)
注意:本接口支持查询单品优惠相关退款信息,且仅支持按微信退款单号或商户退款单号查询,
| 请求参数 | 类型 | 描述 |
|---|---|---|
| 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->refundqueryv2->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/refundqueryv2')->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/refundqueryv2']->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->refundqueryv2->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/refundqueryv2')->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/refundqueryv2']->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 | 退款成功时间 |
| promotion_detail | string | 营销详情JSON格式字符串 |
| promotion_id | string | 券ID |
| name | string | 优惠名称 |
| scope | string | 优惠范围GLOBAL | SINGLE 枚举值之一 |
| type | string | 优惠类型COUPON | DISCOUNT 枚举值之一 |
| amount | string | 优惠券面额 |
| activity_id | string | 活动ID |
| wxpay_contribute | string | 微信出资 |
| merchant_contribute | string | 商户出资 |
| other_contribute | string | 其他出资 |
| goods_detail | object[] | 单品列表 |
| goods_id | string | 商品编码 |
| wxpay_goods_id | string | 微信支付商品编码 |
| goods_name | string | 商品名称 |
| quantity | number | 商品数量 |
| price | number | 商品单价 |
参阅 官方文档