Skip to content

查询订单

该接口仅提供微信代扣订单的查询,商户可以通过该接口主动查询微信代扣订单状态,完成下一步的业务逻辑。

请求参数类型描述
xmlobject声明请求的XML数据结构
appidstring请求appid
sub_appidstring子商户公众账号id
mch_idstring商户号
sub_mch_idstring子商户号
transaction_idstring微信订单号
sign_typestring签名类型
HMAC-SHA256 枚举值
php
$instance->v2->transit->partnerpay->queryorder->postAsync([
  'xml' => [
    'appid'          => 'wxcbda96de0b165486',
    'sub_appid'      => 'wxcbda96de0b165489',
    'mch_id'         => '10000098',
    'sub_mch_id'     => '1900000109',
    'transaction_id' => '1009660380201506130728806387',
    'sign_type'      => 'HMAC-SHA256',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/transit/partnerpay/queryorder')->postAsync([
  'xml' => [
    'appid'          => 'wxcbda96de0b165486',
    'sub_appid'      => 'wxcbda96de0b165489',
    'mch_id'         => '10000098',
    'sub_mch_id'     => '1900000109',
    'transaction_id' => '1009660380201506130728806387',
    'sign_type'      => 'HMAC-SHA256',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/transit/partnerpay/queryorder']->postAsync([
  'xml' => [
    'appid'          => 'wxcbda96de0b165486',
    'sub_appid'      => 'wxcbda96de0b165489',
    'mch_id'         => '10000098',
    'sub_mch_id'     => '1900000109',
    'transaction_id' => '1009660380201506130728806387',
    'sign_type'      => 'HMAC-SHA256',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->transit->partnerpay->queryorder->post([
  'xml' => [
    'appid'          => 'wxcbda96de0b165486',
    'sub_appid'      => 'wxcbda96de0b165489',
    'mch_id'         => '10000098',
    'sub_mch_id'     => '1900000109',
    'transaction_id' => '1009660380201506130728806387',
    'sign_type'      => 'HMAC-SHA256',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/transit/partnerpay/queryorder')->post([
  'xml' => [
    'appid'          => 'wxcbda96de0b165486',
    'sub_appid'      => 'wxcbda96de0b165489',
    'mch_id'         => '10000098',
    'sub_mch_id'     => '1900000109',
    'transaction_id' => '1009660380201506130728806387',
    'sign_type'      => 'HMAC-SHA256',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/transit/partnerpay/queryorder']->post([
  'xml' => [
    'appid'          => 'wxcbda96de0b165486',
    'sub_appid'      => 'wxcbda96de0b165489',
    'mch_id'         => '10000098',
    'sub_mch_id'     => '1900000109',
    'transaction_id' => '1009660380201506130728806387',
    'sign_type'      => 'HMAC-SHA256',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
appidstring请求appid
sub_appidstring子商户公众账号id
mch_idstring商户号
sub_mch_idstring子商户号
nonce_strstring随机字符串
signstring签名
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
device_infostring设备号
openidstring用户标识
sub_openidstring用户子标识
is_subscribestring是否关注公众账号
Y | N 枚举值之一
trade_typestring交易类型
PAP 枚举值
trade_statestring交易状态
SUCCESS | REFUND | NOTPAY | CLOSED | REVOKED | USERPAYING | PAYERROR | ACCEPT 枚举值之一
bank_typestring付款银行
total_feeinteger总金额
fee_typestring货币种类
cash_feeinteger现金支付金额
cash_fee_typestring现金支付货币类型
settlement_total_feeinteger应结订单金额
coupon_feeinteger代金券或立减优惠金额
coupon_countinteger代金券或立减优惠使用数量
coupon_type_$nstring代金券类型
coupon_id_$nstring代金券或立减优惠ID
coupon_fee_$ninteger单个代金券或立减优惠支付金额
transaction_idstring微信支付订单号
out_trade_nostring商户订单号
attachstring附加数据
time_endstring支付完成时间
trade_state_descstring交易状态描述

参阅 官方文档

Published on the GitHub by TheNorthMemory