Skip to content

微信支付订单号查询

商户可以通过查询订单接口主动查询订单状态,完成下一步的业务逻辑。查询订单状态可通过微信支付订单号或商户订单号两种方式查询

请求参数类型描述
transaction_idstring微信支付订单号
queryobject声明请求的查询参数
sp_mchidstring服务商户号
sub_mchidstring子商户号
php
$instance->v3->pay->partner->transactions->id->_transaction_id_->getAsync([
  'transaction_id' => '',
  'query' => [
    'sp_mchid' => '',
    'sub_mchid' => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/pay/partner/transactions/id/{transaction_id}')->getAsync([
  'transaction_id' => '',
  'query' => [
    'sp_mchid' => '',
    'sub_mchid' => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/pay/partner/transactions/id/{transaction_id}']->getAsync([
  'transaction_id' => '',
  'query' => [
    'sp_mchid' => '',
    'sub_mchid' => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->pay->partner->transactions->id->_transaction_id_->get([
  'transaction_id' => '',
  'query' => [
    'sp_mchid' => '',
    'sub_mchid' => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/pay/partner/transactions/id/{transaction_id}')->get([
  'transaction_id' => '',
  'query' => [
    'sp_mchid' => '',
    'sub_mchid' => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/pay/partner/transactions/id/{transaction_id}']->get([
  'transaction_id' => '',
  'query' => [
    'sp_mchid' => '',
    'sub_mchid' => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sp_appidstring服务商公众号ID
sp_mchidstring服务商户号
sub_appidstring子商户公众号ID
sub_mchidstring子商户号
settle_infoobject结算信息
profit_sharingboolean是否指定分账
subsidy_amountinteger补差金额
transaction_idstring微信支付订单号
trade_typestring
trade_statestring
trade_state_descstring交易状态描述
bank_typestring付款银行
success_timestring支付完成时间
descriptionstring商品描述
attachstring附加数据
out_trade_nostring商户订单号
amountobject订单金额
totalinteger总金额
currencystring货币类型
time_expirestring交易结束时间
notify_urlstring通知地址
goods_tagstring订单优惠标记
limit_paystring[]支付方式
no_balance | no_credit | no_debit | balance_only 枚举值之一
support_fapiaoboolean电子发票入口开放标识
detailobject优惠功能
cost_priceinteger订单原价
invoice_idstring商品小票ID
goods_detailobject[]单品列表
merchant_goods_idstring商户侧商品编码
wechatpay_goods_idstring微信侧商品编码
goods_namestring商品名称
quantityinteger商品数量
unit_priceinteger商品单价
scene_infoobject场景信息
payer_client_ipstring用户终端IP
device_idstring商户端设备号
store_infoobject商户门店信息
idstring门店编号
namestring门店名称
area_codestring地区编码
addressstring详细地址
payerobject支付者
sp_openidstring用户服务标识
sub_openidstring用户子标识

参阅 官方文档

Published on the GitHub by TheNorthMemory