Skip to content

查询订单

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

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

参阅 官方文档

Published on the GitHub by TheNorthMemory