Skip to content

查询退款(押金)

提交退款申请后,通过调用该接口查询退款状态。退款有一定延时,用零钱支付的退款20分钟内到账,银行卡支付的退款3个工作日后重新查询退款状态;

请求参数类型描述
xmlobject声明请求的XML数据结构
appidstring公众账号ID
mch_idstring商户号
sub_appidstring子商户公众账号ID
sub_mch_idstring子商户号
sign_typestring签名类型
MD5 | HMAC-SHA256 枚举值之一
transaction_idstring微信订单号
out_trade_nostring商户订单号
out_refund_nostring商户退款单号
refund_idstring微信退款单号
offsetinteger偏移量
php
$instance->v2->deposit->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/deposit/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/deposit/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->deposit->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/deposit/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/deposit/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_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误码
err_code_desstring错误描述
appidstring公众账号ID
mch_idstring商户号
sub_appidstring子商户公众账号ID
sub_mch_idstring子商户号
nonce_strstring随机字符串
signstring签名
total_refund_countinteger订单总退款次数
transaction_idstring微信订单号
out_trade_nostring商户订单号
total_feeinteger订单金额
settlement_total_feeinteger应结订单金额
fee_typestring货币种类
cash_feeinteger现金支付金额
refund_countinteger退款笔数
out_refund_no_$nstring商户退款单号
refund_id_$nstring微信退款单号
refund_channel_$nstring退款渠道
refund_fee_$ninteger申请退款金额
settlement_refund_fee_$ninteger退款金额
coupon_type_$n_$mstring代金券类型
coupon_refund_fee_$ninteger总代金券退款金额
coupon_refund_count_$ninteger退款代金券使用数量
coupon_refund_id_$n_$mstring退款代金券ID
coupon_refund_fee_$n_$minteger单个代金券退款金额
refund_status_$nstring退款状态
refund_account_$nstring退款资金来源
refund_recv_accout_$nstring退款入账账户
refund_success_time_$nstring退款成功时间

参阅 官方文档

Published on the GitHub by TheNorthMemory