查询订单
更新时间:2025.02.21商户通过商户订单号,来查询订单信息
接口说明
支持商户:【普通服务商】
请求方式:【GET】/v3/vehicle/transactions/out-trade-no/{out_trade_no}
请求域名:【主域名】https://api.mch.weixin.qq.com 使用该域名将访问就近的接入点
【备域名】https://api2.mch.weixin.qq.com 使用该域名将访问异地的接入点 ,指引点击查看
请求参数
Header HTTP头参数
Authorization 必填 string
请参考签名认证生成认证信息
Accept 必填 string
请设置为application/json
path 路径参数
out_trade_no 必填 string(32)
【商户订单号】商户系统内部订单号,只能是数字、大小写字母,且在同一个商户号下唯一
query 查询参数
sub_mchid 必填 string(32)
【子商户号】微信支付分配的子商户号,服务商模式下必传
请求示例
GET
1curl -X GET \ 2 https://api.mch.weixin.qq.com/v3/vehicle/transactions/out-trade-no/20150806125346?sub_mchid=1900000109 \ 3 -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \ 4 -H "Accept: application/json" 5
需配合微信支付工具库 WXPayUtility 使用,请参考Java
1package com.java.demo; 2 3import com.java.utils.WXPayUtility; // 引用微信支付工具库,参考:https://pay.weixin.qq.com/doc/v3/partner/4014985777 4 5import com.google.gson.annotations.SerializedName; 6import com.google.gson.annotations.Expose; 7import okhttp3.MediaType; 8import okhttp3.OkHttpClient; 9import okhttp3.Request; 10import okhttp3.RequestBody; 11import okhttp3.Response; 12 13import java.io.IOException; 14import java.io.UncheckedIOException; 15import java.security.PrivateKey; 16import java.security.PublicKey; 17import java.util.ArrayList; 18import java.util.HashMap; 19import java.util.List; 20import java.util.Map; 21 22/** 23 * 查询订单 24 */ 25public class QueryTransaction { 26 private static String HOST = "https://api.mch.weixin.qq.com"; 27 private static String METHOD = "GET"; 28 private static String PATH = "/v3/vehicle/transactions/out-trade-no/{out_trade_no}"; 29 30 public static void main(String[] args) { 31 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 32 QueryTransaction client = new QueryTransaction( 33 "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 34 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 35 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 36 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 37 "/path/to/wxp_pub.pem" // 微信支付公钥文件路径,本地文件路径 38 ); 39 40 QueryTransactionRequest request = new QueryTransactionRequest(); 41 request.outTradeNo = "20150806125346"; 42 request.subMchid = "1900000109"; 43 try { 44 Transaction response = client.run(request); 45 // TODO: 请求成功,继续业务逻辑 46 System.out.println(response); 47 } catch (WXPayUtility.ApiException e) { 48 // TODO: 请求失败,根据状态码执行不同的逻辑 49 e.printStackTrace(); 50 } 51 } 52 53 public Transaction run(QueryTransactionRequest request) { 54 String uri = PATH; 55 uri = uri.replace("{out_trade_no}", WXPayUtility.urlEncode(request.outTradeNo)); 56 Map<String, Object> args = new HashMap<>(); 57 args.put("sub_mchid", request.subMchid); 58 String queryString = WXPayUtility.urlEncode(args); 59 if (!queryString.isEmpty()) { 60 uri = uri + "?" + queryString; 61 } 62 63 Request.Builder reqBuilder = new Request.Builder().url(HOST + uri); 64 reqBuilder.addHeader("Accept", "application/json"); 65 reqBuilder.addHeader("Wechatpay-Serial", wechatPayPublicKeyId); 66 reqBuilder.addHeader("Authorization", WXPayUtility.buildAuthorization(mchid, certificateSerialNo, privateKey, METHOD, uri, null)); 67 reqBuilder.method(METHOD, null); 68 Request httpRequest = reqBuilder.build(); 69 70 // 发送HTTP请求 71 OkHttpClient client = new OkHttpClient.Builder().build(); 72 try (Response httpResponse = client.newCall(httpRequest).execute()) { 73 String respBody = WXPayUtility.extractBody(httpResponse); 74 if (httpResponse.code() >= 200 && httpResponse.code() < 300) { 75 // 2XX 成功,验证应答签名 76 WXPayUtility.validateResponse(this.wechatPayPublicKeyId, this.wechatPayPublicKey, 77 httpResponse.headers(), respBody); 78 79 // 从HTTP应答报文构建返回数据 80 return WXPayUtility.fromJson(respBody, Transaction.class); 81 } else { 82 throw new WXPayUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers()); 83 } 84 } catch (IOException e) { 85 throw new UncheckedIOException("Sending request to " + uri + " failed.", e); 86 } 87 } 88 89 private final String mchid; 90 private final String certificateSerialNo; 91 private final PrivateKey privateKey; 92 private final String wechatPayPublicKeyId; 93 private final PublicKey wechatPayPublicKey; 94 95 public QueryTransaction(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) { 96 this.mchid = mchid; 97 this.certificateSerialNo = certificateSerialNo; 98 this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath); 99 this.wechatPayPublicKeyId = wechatPayPublicKeyId; 100 this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath); 101 } 102 103 public static class QueryTransactionRequest { 104 @SerializedName("sub_mchid") 105 @Expose(serialize = false) 106 public String subMchid; 107 108 @SerializedName("out_trade_no") 109 @Expose(serialize = false) 110 public String outTradeNo; 111 } 112 113 public static class Transaction { 114 @SerializedName("appid") 115 public String appid; 116 117 @SerializedName("sub_appid") 118 public String subAppid; 119 120 @SerializedName("sp_mchid") 121 public String spMchid; 122 123 @SerializedName("sub_mchid") 124 public String subMchid; 125 126 @SerializedName("description") 127 public String description; 128 129 @SerializedName("create_time") 130 public String createTime; 131 132 @SerializedName("out_trade_no") 133 public String outTradeNo; 134 135 @SerializedName("transaction_id") 136 public String transactionId; 137 138 @SerializedName("trade_state") 139 public String tradeState; 140 141 @SerializedName("trade_state_description") 142 public String tradeStateDescription; 143 144 @SerializedName("success_time") 145 public String successTime; 146 147 @SerializedName("bank_type") 148 public String bankType; 149 150 @SerializedName("user_repaid") 151 public String userRepaid; 152 153 @SerializedName("attach") 154 public String attach; 155 156 @SerializedName("trade_scene") 157 public String tradeScene; 158 159 @SerializedName("parking_info") 160 public ParkingTradeScene parkingInfo; 161 162 @SerializedName("payer") 163 public Payer payer; 164 165 @SerializedName("amount") 166 public QueryOrderAmount amount; 167 168 @SerializedName("promotion_detail") 169 public List<PromotionDetail> promotionDetail; 170 } 171 172 public static class ParkingTradeScene { 173 @SerializedName("parking_id") 174 public String parkingId; 175 176 @SerializedName("plate_number") 177 public String plateNumber; 178 179 @SerializedName("plate_color") 180 public PlateColor plateColor; 181 182 @SerializedName("start_time") 183 public String startTime; 184 185 @SerializedName("end_time") 186 public String endTime; 187 188 @SerializedName("parking_name") 189 public String parkingName; 190 191 @SerializedName("charging_duration") 192 public Long chargingDuration; 193 194 @SerializedName("device_id") 195 public String deviceId; 196 } 197 198 public static class Payer { 199 @SerializedName("openid") 200 public String openid; 201 202 @SerializedName("sub_openid") 203 public String subOpenid; 204 } 205 206 public static class QueryOrderAmount { 207 @SerializedName("total") 208 public Long total; 209 210 @SerializedName("currency") 211 public String currency; 212 213 @SerializedName("payer_total") 214 public Long payerTotal; 215 216 @SerializedName("discount_total") 217 public Long discountTotal; 218 } 219 220 public static class PromotionDetail { 221 @SerializedName("coupon_id") 222 public String couponId; 223 224 @SerializedName("name") 225 public String name; 226 227 @SerializedName("scope") 228 public String scope; 229 230 @SerializedName("type") 231 public String type; 232 233 @SerializedName("stock_id") 234 public String stockId; 235 236 @SerializedName("amount") 237 public Long amount; 238 239 @SerializedName("wechatpay_contribute") 240 public Long wechatpayContribute; 241 242 @SerializedName("merchant_contribute") 243 public Long merchantContribute; 244 245 @SerializedName("other_contribute") 246 public Long otherContribute; 247 248 @SerializedName("currency") 249 public String currency; 250 } 251 252 public enum PlateColor { 253 @SerializedName("BLUE") 254 BLUE, 255 @SerializedName("GREEN") 256 GREEN, 257 @SerializedName("YELLOW") 258 YELLOW, 259 @SerializedName("BLACK") 260 BLACK, 261 @SerializedName("WHITE") 262 WHITE, 263 @SerializedName("LIMEGREEN") 264 LIMEGREEN 265 } 266 267} 268
需配合微信支付工具库 wxpay_utility 使用,请参考Go
1package main 2 3import ( 4 "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 5 "encoding/json" 6 "fmt" 7 "net/http" 8 "net/url" 9 "strings" 10 "time" 11) 12 13func main() { 14 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 15 config, err := wxpay_utility.CreateMchConfig( 16 "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 17 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 18 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 19 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 20 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 21 ) 22 if err != nil { 23 fmt.Println(err) 24 return 25 } 26 27 request := &QueryTransactionRequest{ 28 SubMchid: wxpay_utility.String("1900000109"), 29 OutTradeNo: wxpay_utility.String("20150806125346"), 30 } 31 32 response, err := QueryTransaction(config, request) 33 if err != nil { 34 fmt.Printf("请求失败: %+v\n", err) 35 // TODO: 请求失败,根据状态码执行不同的处理 36 return 37 } 38 39 // TODO: 请求成功,继续业务逻辑 40 fmt.Printf("请求成功: %+v\n", response) 41} 42 43func QueryTransaction(config *wxpay_utility.MchConfig, request *QueryTransactionRequest) (response *Transaction, err error) { 44 const ( 45 host = "https://api.mch.weixin.qq.com" 46 method = "GET" 47 path = "/v3/vehicle/transactions/out-trade-no/{out_trade_no}" 48 ) 49 50 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path)) 51 if err != nil { 52 return nil, err 53 } 54 reqUrl.Path = strings.Replace(reqUrl.Path, "{out_trade_no}", url.PathEscape(*request.OutTradeNo), -1) 55 query := reqUrl.Query() 56 if request.SubMchid != nil { 57 query.Add("sub_mchid", *request.SubMchid) 58 } 59 reqUrl.RawQuery = query.Encode() 60 httpRequest, err := http.NewRequest(method, reqUrl.String(), nil) 61 if err != nil { 62 return nil, err 63 } 64 httpRequest.Header.Set("Accept", "application/json") 65 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId()) 66 authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), nil) 67 if err != nil { 68 return nil, err 69 } 70 httpRequest.Header.Set("Authorization", authorization) 71 72 client := &http.Client{} 73 httpResponse, err := client.Do(httpRequest) 74 if err != nil { 75 return nil, err 76 } 77 respBody, err := wxpay_utility.ExtractResponseBody(httpResponse) 78 if err != nil { 79 return nil, err 80 } 81 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 { 82 // 2XX 成功,验证应答签名 83 err = wxpay_utility.ValidateResponse( 84 config.WechatPayPublicKeyId(), 85 config.WechatPayPublicKey(), 86 &httpResponse.Header, 87 respBody, 88 ) 89 if err != nil { 90 return nil, err 91 } 92 response := &Transaction{} 93 if err := json.Unmarshal(respBody, response); err != nil { 94 return nil, err 95 } 96 97 return response, nil 98 } else { 99 return nil, wxpay_utility.NewApiException( 100 httpResponse.StatusCode, 101 httpResponse.Header, 102 respBody, 103 ) 104 } 105} 106 107type QueryTransactionRequest struct { 108 SubMchid *string `json:"sub_mchid,omitempty"` 109 OutTradeNo *string `json:"out_trade_no,omitempty"` 110} 111 112func (o *QueryTransactionRequest) MarshalJSON() ([]byte, error) { 113 type Alias QueryTransactionRequest 114 a := &struct { 115 SubMchid *string `json:"sub_mchid,omitempty"` 116 OutTradeNo *string `json:"out_trade_no,omitempty"` 117 *Alias 118 }{ 119 // 序列化时移除非 Body 字段 120 SubMchid: nil, 121 OutTradeNo: nil, 122 Alias: (*Alias)(o), 123 } 124 return json.Marshal(a) 125} 126 127type Transaction struct { 128 Appid *string `json:"appid,omitempty"` 129 SubAppid *string `json:"sub_appid,omitempty"` 130 SpMchid *string `json:"sp_mchid,omitempty"` 131 SubMchid *string `json:"sub_mchid,omitempty"` 132 Description *string `json:"description,omitempty"` 133 CreateTime *time.Time `json:"create_time,omitempty"` 134 OutTradeNo *string `json:"out_trade_no,omitempty"` 135 TransactionId *string `json:"transaction_id,omitempty"` 136 TradeState *string `json:"trade_state,omitempty"` 137 TradeStateDescription *string `json:"trade_state_description,omitempty"` 138 SuccessTime *time.Time `json:"success_time,omitempty"` 139 BankType *string `json:"bank_type,omitempty"` 140 UserRepaid *string `json:"user_repaid,omitempty"` 141 Attach *string `json:"attach,omitempty"` 142 TradeScene *string `json:"trade_scene,omitempty"` 143 ParkingInfo *ParkingTradeScene `json:"parking_info,omitempty"` 144 Payer *Payer `json:"payer,omitempty"` 145 Amount *QueryOrderAmount `json:"amount,omitempty"` 146 PromotionDetail []PromotionDetail `json:"promotion_detail,omitempty"` 147} 148 149type ParkingTradeScene struct { 150 ParkingId *string `json:"parking_id,omitempty"` 151 PlateNumber *string `json:"plate_number,omitempty"` 152 PlateColor *PlateColor `json:"plate_color,omitempty"` 153 StartTime *time.Time `json:"start_time,omitempty"` 154 EndTime *time.Time `json:"end_time,omitempty"` 155 ParkingName *string `json:"parking_name,omitempty"` 156 ChargingDuration *int64 `json:"charging_duration,omitempty"` 157 DeviceId *string `json:"device_id,omitempty"` 158} 159 160type Payer struct { 161 Openid *string `json:"openid,omitempty"` 162 SubOpenid *string `json:"sub_openid,omitempty"` 163} 164 165type QueryOrderAmount struct { 166 Total *int64 `json:"total,omitempty"` 167 Currency *string `json:"currency,omitempty"` 168 PayerTotal *int64 `json:"payer_total,omitempty"` 169 DiscountTotal *int64 `json:"discount_total,omitempty"` 170} 171 172type PromotionDetail struct { 173 CouponId *string `json:"coupon_id,omitempty"` 174 Name *string `json:"name,omitempty"` 175 Scope *string `json:"scope,omitempty"` 176 Type *string `json:"type,omitempty"` 177 StockId *string `json:"stock_id,omitempty"` 178 Amount *int64 `json:"amount,omitempty"` 179 WechatpayContribute *int64 `json:"wechatpay_contribute,omitempty"` 180 MerchantContribute *int64 `json:"merchant_contribute,omitempty"` 181 OtherContribute *int64 `json:"other_contribute,omitempty"` 182 Currency *string `json:"currency,omitempty"` 183} 184 185type PlateColor string 186 187func (e PlateColor) Ptr() *PlateColor { 188 return &e 189} 190 191const ( 192 PLATECOLOR_BLUE PlateColor = "BLUE" 193 PLATECOLOR_GREEN PlateColor = "GREEN" 194 PLATECOLOR_YELLOW PlateColor = "YELLOW" 195 PLATECOLOR_BLACK PlateColor = "BLACK" 196 PLATECOLOR_WHITE PlateColor = "WHITE" 197 PLATECOLOR_LIMEGREEN PlateColor = "LIMEGREEN" 198) 199
应答参数
|
appid 必填 string(32)
【公众账号ID】AppID是商户在微信申请公众号或移动应用成功后分配的账号ID,登录平台为mp.weixin.qq.com或open.weixin.qq.com
sub_appid 选填 string(32)
【子商户公众账号ID】子商户申请的公众号或移动应用AppID,需要在服务商的商户平台为子商户绑定
sp_mchid 必填 string(32)
【商户号】微信支付分配的商户号
sub_mchid 必填 string(32)
【子商户号】微信支付分配的子商户号
description 必填 string(128)
【服务描述】商户自定义字段,用于交易账单中对扣费服务的描述。
create_time 必填 string(32)
【订单创建时间】订单成功创建时返回,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
out_trade_no 必填 string(32)
【商户订单号】商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一
transaction_id 选填 string(32)
【微信支付订单号】微信支付订单号
trade_state 必填 string(32)
【交易状态】SUCCESS—支付成功
ACCEPTED—已接收,等待扣款
PAY_FAIL–支付失败(其他原因,如银行返回失败)
REFUND—转入退款
trade_state_description 选填 string(256)
【交易状态描述】对当前订单状态的描述和下一步操作的指引
success_time 选填 string(32)
【支付完成时间】订单支付完成时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
bank_type 选填 string(16)
【付款银行】银行类型,采用字符串类型的银行标识。BPA:该笔订单由微信进行垫付
user_repaid 选填 string(1)
【用户是否已还款】枚举值:
Y:用户已还款
N:用户未还款
注意:使用此字段前需先确认bank_type字段值为BPA以及 trade_state字段值为SUCCESS。
attach 选填 string(128)
【附加数据】附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
trade_scene 必填 string(32)
【交易场景】交易场景值,目前支持 :PARKING:车场停车场景
parking_info 选填 object
【停车场景信息】返回信息中的trade_scene为PARKING,返回该场景信息
属性 | |
parking_id 必填 string(32) 【入场ID】微信支付分停车服务为商户分配的入场ID,商户通过入场通知接口获取入场ID plate_number 必填 string(32) 【车牌号】车牌号,仅包括省份+车牌,不包括特殊字符。 plate_color 必填 string 【车牌颜色】车牌颜色 可选取值:
start_time 必填 string(32) 【入场时间】用户入场时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 end_time 必填 string(32) 【出场时间】用户出场时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 parking_name 必填 string(32) 【停车场名称】所在停车位车场的名称 charging_duration 必填 integer 【计费时长】计费的时间长,单位为秒 device_id 必填 string(32) 【停车场设备ID】停车场设备ID |
payer 必填 object
【支付者信息】支付者信息
属性 | |
openid 必填 string(32) 【用户在AppID下的标识】用户在AppID下的唯一标识 sub_openid 选填 string(32) 【用户在Sub_AppID下的标识】用户在Sub_AppID下的标识,商户扣费时传入了Sub_AppID,则会返回该用户在Sub_AppID下的标识 |
amount 必填 object
【订单金额信息】订单金额信息
属性 | |
total 必填 integer 【订单金额】订单总金额,单位为分,只能为整数,详见支付金额 currency 选填 string(16) 【货币类型】符合ISO 4217标准的三位字母代码,目前只支持人民币:CNY payer_total 选填 integer 【用户实际支付金额】用户实际支付金额,单位为分,只能为整数,详见支付金额 discount_total 选填 integer 【折扣】订单折扣 |
promotion_detail 选填 array[object]
【优惠信息】优惠信息
属性 | |
coupon_id 必填 string(32) 【券ID】券或者立减优惠ID name 选填 string(128) 【优惠名称】优惠名称 scope 选填 string(32) 【优惠范围】GLOBAL-全场代金券, type 选填 string(16) 【优惠类型】枚举值: stock_id 选填 string(32) 【活动ID】在微信商户后台配置的批次ID amount 必填 integer 【优惠券面额】用户享受优惠的金额 wechatpay_contribute 选填 integer 【微信出资】特指由微信支付商户平台创建的优惠,出资金额等于本项优惠总金额,单位为分 merchant_contribute 选填 integer 【商户出资】特指商户自己创建的优惠,出资金额等于本项优惠总金额,单位为分 other_contribute 选填 integer 【其他出资】其他出资方出资金额,单位为分 currency 选填 string(16) 【优惠币种】CNY:人民币,境内商户号仅支持人民币。 |
应答示例
200 OK
1{ 2 "appid" : "wxcbda96de0b165486", 3 "sub_appid" : "wxcbda96de0b165489", 4 "sp_mchid" : "1230000109", 5 "sub_mchid" : "1900000109", 6 "description" : "停车场扣费", 7 "create_time" : "2017-08-26T10:43:39+08:00", 8 "out_trade_no" : "20150806125346", 9 "transaction_id" : "1009660380201506130728806387", 10 "trade_state" : "SUCCESS", 11 "trade_state_description" : "支付失败,请重新下单支付", 12 "success_time" : "2017-08-26T10:43:39+08:00", 13 "bank_type" : "CMC", 14 "user_repaid" : "Y", 15 "attach" : "深圳分店", 16 "trade_scene" : "PARKING", 17 "parking_info" : { 18 "parking_id" : "5K8264ILTKCH16CQ250", 19 "plate_number" : "粤B888888", 20 "plate_color" : "BLUE", 21 "start_time" : "2017-08-26T10:43:39+08:00", 22 "end_time" : "2017-08-26T10:43:39+08:00", 23 "parking_name" : "欢乐海岸停车场", 24 "charging_duration" : 3600, 25 "device_id" : "12313" 26 }, 27 "payer" : { 28 "openid" : "oUpF8uMuAJOM2pxb1Q", 29 "sub_openid" : "oUpF8uMuAJOM2pxb1Q" 30 }, 31 "amount" : { 32 "total" : 888, 33 "currency" : "CNY", 34 "payer_total" : 100, 35 "discount_total" : 100 36 }, 37 "promotion_detail" : [ 38 { 39 "coupon_id" : "109519", 40 "name" : "单品惠-6", 41 "scope" : "SINGLE", 42 "type" : "CASH", 43 "stock_id" : "931386", 44 "amount" : 5, 45 "wechatpay_contribute" : 1, 46 "merchant_contribute" : 1, 47 "other_contribute" : 1, 48 "currency" : "CNY" 49 } 50 ] 51} 52
错误码
公共错误码
状态码 | 错误码 | 描述 | 解决方案 |
---|---|---|---|
400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
400 | INVALID_REQUEST | HTTP 请求不符合微信支付 APIv3 接口规则 | 请参阅 接口规则 |
401 | SIGN_ERROR | 验证不通过 | 请参阅 签名常见问题 |
500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |
业务错误码
状态码 | 错误码 | 描述 | 解决方案 |
---|---|---|---|
400 | INVALID_REQUEST | 不支持查询非支付分停车订单,请更换单号后再试 | 商户查询的订单非支付分停车订单,该接口只支持查询通过支付分停车受理扣款接口下单的订单信息,请更换单号后再试 |
400 | INVALID_REQUEST | 服务商和子商户没有绑定关系 | 检查请求中的sub_mchid与服务商商户号是否匹配,然后重试 |
400 | PARAM_ERROR | 参数错误,请检查out_trade_no | 参数错误,请检查out_trade_no为创建订单时的商户订单号 |
404 | NOT_FOUND | 订单不存在 | 请确认out_trade_no正确且为当前商户的订单 |
429 | RATELIMIT_EXCEEDED | 达到调用速率限制 | 接口调用频率过快,请降低请求频率 |
500 | SYSTEM_ERROR | 出现内部服务器错误 | 5开头的错误码均为系统错误,请使用相同的参数稍后重试 |