还款下单
更新时间:2025.05.29接口说明
支持商户:【平台商户】
请求方式:【POST】/v3/repayment/combine-transactions/partner/prepay
请求域名:【主域名】https://api.mch.weixin.qq.com 使用该域名将访问就近的接入点
【备域名】https://api2.mch.weixin.qq.com 使用该域名将访问异地的接入点 ,指引点击查看
请求参数
Header HTTP头参数
Authorization 必填 string
请参考签名认证生成认证信息
Accept 必填 string
请设置为application/json
Content-Type 必填 string
请设置为application/json
body 包体参数
combine_out_trade_no 必填 string(32)
【还款单订单号】 商户系统内部对还款单订单定义的订单号,最短2个字符,最长32个字符,只能是数字、大小写字母,以及_-|* ,且在同一个商户号下唯一
combine_mchid 必填 string(32)
【还款服务商商户号】 还款发起方商户号,是由微信支付系统生成并分配给每个服务商的唯一标识符,具体请参考服务商模式开发必要参数说明。
sub_orders 必填 array[object]
【还款明细单信息列表】 还款明细单信息,最多支持还款单条数:10
| 属性 | |||||||||
mchid 必填 string(32) 【还款单发起商户号 】 此处请填写服务商(还款发起方)的商户号combine_mchid sub_mchid 必填 string(32) 【子商户号(也叫特约商户号)】 子单参与方,由服务商为子商户进件后获取,具体请参考服务商模式开发必要参数说明。 out_trade_no 必填 string(32) 【还款明细单订单号】 商户系统内部对还款明细单定义的订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 amount 必填 object 【订单金额】 订单金额。
attach 必填 string(128) 【商户数据包】 服务商在创建订单时可传入自定义数据包,该数据对用户不可见,用于存储订单相关的服务商自定义信息,其总长度限制在128字符以内,查询API和支付通知中原样返回,并且该字段还会体现在交易账单。 description 必填 string(127) 【产品描述】 对产品信息的描述,将展示在用户的支付密码确认页、支付凭证、用户账单详情中。服务商需传递能真实代表产品信息的描述,不能超过127个字符。 settle_info 选填 object 【结算信息】 结算信息。
|
time_expire 选填 string
【交易结束时间】 1、定义:支付结束时间是指用户能够完成该笔订单支付的最后时限,并非订单关闭的时间。超过此时间后,用户将无法对该笔订单进行支付。如需关闭订单,请调用还款关闭接口。
2、格式要求:支付结束时间需遵循rfc3339标准格式:yyyy-MM-DDTHH:mm:ss+TIMEZONE。yyyy-MM-DD 表示年月日;T 字符用于分隔日期和时间部分;HH:mm:ss 表示具体的时分秒;TIMEZONE 表示时区(例如,+08:00 对应东八区时间,即北京时间)。
示例:2015-05-20T13:29:35+08:00 表示北京时间2015年5月20日13点29分35秒。
3、注意事项:
time_expire参数仅在用户首次下单时可设置,且不允许后续修改,尝试修改将导致错误。若用户实际进行支付的时间超过了订单设置的支付结束时间,服务商需使用新的商户订单号下单,生成新的订单供用户进行支付。若未超过支付结束时间,则可使用原参数重新请求下单接口,以获取当前订单最新的
prepay_id进行支付。支付结束时间不能早于下单时间后1分钟,若设置的支付结束时间早于该时间,系统将自动调整为下单时间后1分钟作为支付结束时间。
notify_url 选填 string(255)
【通知地址】 服务商接收还款支付成功回调通知的地址,需按照notify_url填写注意事项规范填写。
h5_info 选填 object
【H5调起支付场景信息】 还款支付调起微信支付收银台的场景信息,miniprogram_info,app_info,h5_info,wechat_web_info至少需传入一个,支付过程中将检查场景信息是否正确。
| 属性 | |
combine_appid 必填 string(32) 【还款服务商APPID】 服务商(还款发起方)的APPID。APPID是微信开放平台(移动应用)或微信公众平台(小程序、公众号)为开发者的应用程序提供的唯一标识。此处可以填写这三种类型中的任意一种APPID,并确保该combine_appid与combine_mchid有绑定关系。详见:商户号绑定APPID操作说明。 payer_client_ip 必填 string(45) 【用户终端IP】 用户端实际IP,支持IPv4和IPv6两种格式的IP地址。 type 必填 string(32) 【场景类型】 场景类型,使用H5还款的场景:Wap、iOS、Android、Harmony app_name 选填 string(64) 【应用名称】 应用名称 app_url 必填 string(128) 【网站URL】 网站URL bundle_id 选填 string(128) 【iOS平台BundleID】 iOS平台BundleID package_name 选填 string(128) 【Android平台PackageName】 Android平台PackageName |
app_info 选填 object
【APP调起支付场景信息】 还款支付调起微信支付收银台的场景信息,miniprogram_info,app_info,h5_info,wechat_web_info至少需传入一个,支付过程中将检查场景信息是否正确。
| 属性 | |
combine_appid 必填 string(32) 【还款服务商APPID】 服务商(还款发起方)的APPID。APPID是微信开放平台(移动应用)或微信公众平台(小程序、公众号)为开发者的应用程序提供的唯一标识。此处请填写移动应用类型的APPID,并确保该combine_appid与combine_mchid有绑定关系。详见:商户号绑定APPID操作说明。 |
miniprogram_info 选填 object
【小程序调起支付场景信息】 还款支付调起微信支付收银台的场景信息,miniprogram_info,app_info,h5_info,wechat_web_info至少需传入一个,支付过程中将检查场景信息是否正确。
| 属性 | |
combine_appid 必填 string(32) 【还款服务商APPID】 服务商(还款发起方)的APPID。APPID是微信开放平台(移动应用)或微信公众平台(小程序、公众号)为开发者的应用程序提供的唯一标识。此处请填写小程序类型的APPID,并确保该combine_appid与combine_mchid有绑定关系。详见:商户号绑定APPID操作说明。 openid 必填 string(128) 【用户标识】 用户在还款服务商商户号绑定的combine_appid下的唯一标识,获取方式详见 获取OpenID文档。 |
wechat_web_info 选填 object
【微信内网页调起支付场景信息】 还款支付调起微信支付收银台的场景信息,miniprogram_info,app_info,h5_info,wechat_web_info至少需传入一个,支付过程中将检查场景信息是否正确。
| 属性 | |
combine_appid 必填 string(32) 【还款服务商APPID】 服务商(还款发起方)的APPID。APPID是微信开放平台(移动应用)或微信公众平台(小程序、公众号)为开发者的应用程序提供的唯一标识。此处请填写小程序类型的APPID,并确保该combine_appid与combine_mchid有绑定关系。详见:商户号绑定APPID操作说明。 openid 必填 string(128) 【用户标识】 用户在还款服务商商户号绑定的combine_appid下的唯一标识,获取方式详见 获取OpenID文档。 webview_url 必填 string(128) 【网页经营场景URL】 网页经营场景域名,需为发起微信内网页支付的域名,并在网络经营场景中绑定。 |
请求示例
POST
1curl -X POST \ 2 https://api.mch.weixin.qq.com/v3/repayment/combine-transactions/partner/prepay \ 3 -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \ 4 -H "Accept: application/json" \ 5 -H "Content-Type: application/json" \ 6 -d '{ 7 "combine_out_trade_no" : "1217752501201407033233368018", 8 "combine_mchid" : "1230000109", 9 "sub_orders" : [ 10 { 11 "mchid" : "1230000109", 12 "sub_mchid" : "1900000109", 13 "out_trade_no" : "20150806125346", 14 "amount" : { 15 "total_amount" : 10, 16 "currency" : "CNY" 17 }, 18 "attach" : "深圳分店", 19 "description" : "某某放心借", 20 "settle_info" : { 21 "profit_sharing" : false, 22 "subsidy_amount" : 10 23 } 24 } 25 ], 26 "time_expire" : "2018-06-08T10:34:56+08:00", 27 "notify_url" : "https://yourapp.com/notify", 28 "h5_info" : { 29 "combine_appid" : "wxd678efh567hg6787", 30 "payer_client_ip" : "14.23.150.211", 31 "type" : "iOS", 32 "app_name" : "王者荣耀", 33 "app_url" : "https://pay.qq.com", 34 "bundle_id" : "com.tencent.wzryiOS", 35 "package_name" : "com.tencent.tmgp.sgame" 36 }, 37 "app_info" : { 38 "combine_appid" : "wxd678efh567hg6787" 39 }, 40 "miniprogram_info" : { 41 "combine_appid" : "wxd678efh567hg6787", 42 "openid" : "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o\t" 43 } 44 }' 45
需配合微信支付工具库 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 RepaymentPrepay { 26 private static String HOST = "https://api.mch.weixin.qq.com"; 27 private static String METHOD = "POST"; 28 private static String PATH = "/v3/repayment/combine-transactions/partner/prepay"; 29 30 public static void main(String[] args) { 31 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 32 RepaymentPrepay client = new RepaymentPrepay( 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 RepaymentPrepayRequest request = new RepaymentPrepayRequest(); 41 request.combineOutTradeNo = "1217752501201407033233368018"; 42 request.combineMchid = "1230000109"; 43 request.subOrders = new ArrayList<>(); 44 { 45 RepaymentSubOrder subOrdersItem = new RepaymentSubOrder(); 46 subOrdersItem.mchid = "1230000109"; 47 subOrdersItem.subMchid = "1900000109"; 48 subOrdersItem.outTradeNo = "20150806125346"; 49 subOrdersItem.amount = new RepaymentAmountInfo(); 50 subOrdersItem.amount.totalAmount = 10L; 51 subOrdersItem.amount.currency = "CNY"; 52 subOrdersItem.attach = "深圳分店"; 53 subOrdersItem.description = "某某放心借"; 54 subOrdersItem.settleInfo = new RepaymentSettleInfo(); 55 subOrdersItem.settleInfo.profitSharing = false; 56 subOrdersItem.settleInfo.subsidyAmount = 10L; 57 request.subOrders.add(subOrdersItem); 58 }; 59 request.timeExpire = "2018-06-08T10:34:56+08:00"; 60 request.notifyUrl = "https://yourapp.com/notify"; 61 request.h5Info = new RepaymentH5Info(); 62 request.h5Info.combineAppid = "wxd678efh567hg6787"; 63 request.h5Info.payerClientIp = "14.23.150.211"; 64 request.h5Info.type = "iOS"; 65 request.h5Info.appName = "王者荣耀"; 66 request.h5Info.appUrl = "https://pay.qq.com"; 67 request.h5Info.bundleId = "com.tencent.wzryiOS"; 68 request.h5Info.packageName = "com.tencent.tmgp.sgame"; 69 request.appInfo = new RepaymentAppInfo(); 70 request.appInfo.combineAppid = "wxd678efh567hg6787"; 71 request.miniprogramInfo = new RepaymentMiniprogramInfo(); 72 request.miniprogramInfo.combineAppid = "wxd678efh567hg6787"; 73 request.miniprogramInfo.openid = "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o "; 74 try { 75 RepaymentPrepayResponse response = client.run(request); 76 // TODO: 请求成功,继续业务逻辑 77 System.out.println(response); 78 } catch (WXPayUtility.ApiException e) { 79 // TODO: 请求失败,根据状态码执行不同的逻辑 80 e.printStackTrace(); 81 } 82 } 83 84 public RepaymentPrepayResponse run(RepaymentPrepayRequest request) { 85 String uri = PATH; 86 String reqBody = WXPayUtility.toJson(request); 87 88 Request.Builder reqBuilder = new Request.Builder().url(HOST + uri); 89 reqBuilder.addHeader("Accept", "application/json"); 90 reqBuilder.addHeader("Wechatpay-Serial", wechatPayPublicKeyId); 91 reqBuilder.addHeader("Authorization", WXPayUtility.buildAuthorization(mchid, certificateSerialNo,privateKey, METHOD, uri, reqBody)); 92 reqBuilder.addHeader("Content-Type", "application/json"); 93 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), reqBody); 94 reqBuilder.method(METHOD, requestBody); 95 Request httpRequest = reqBuilder.build(); 96 97 // 发送HTTP请求 98 OkHttpClient client = new OkHttpClient.Builder().build(); 99 try (Response httpResponse = client.newCall(httpRequest).execute()) { 100 String respBody = WXPayUtility.extractBody(httpResponse); 101 if (httpResponse.code() >= 200 && httpResponse.code() < 300) { 102 // 2XX 成功,验证应答签名 103 WXPayUtility.validateResponse(this.wechatPayPublicKeyId, this.wechatPayPublicKey, 104 httpResponse.headers(), respBody); 105 106 // 从HTTP应答报文构建返回数据 107 return WXPayUtility.fromJson(respBody, RepaymentPrepayResponse.class); 108 } else { 109 throw new WXPayUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers()); 110 } 111 } catch (IOException e) { 112 throw new UncheckedIOException("Sending request to " + uri + " failed.", e); 113 } 114 } 115 116 private final String mchid; 117 private final String certificateSerialNo; 118 private final PrivateKey privateKey; 119 private final String wechatPayPublicKeyId; 120 private final PublicKey wechatPayPublicKey; 121 122 public RepaymentPrepay(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) { 123 this.mchid = mchid; 124 this.certificateSerialNo = certificateSerialNo; 125 this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath); 126 this.wechatPayPublicKeyId = wechatPayPublicKeyId; 127 this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath); 128 } 129 130 public static class RepaymentPrepayRequest { 131 @SerializedName("combine_out_trade_no") 132 public String combineOutTradeNo; 133 134 @SerializedName("combine_mchid") 135 public String combineMchid; 136 137 @SerializedName("sub_orders") 138 public List<RepaymentSubOrder> subOrders = new ArrayList<RepaymentSubOrder>(); 139 140 @SerializedName("time_expire") 141 public String timeExpire; 142 143 @SerializedName("notify_url") 144 public String notifyUrl; 145 146 @SerializedName("h5_info") 147 public RepaymentH5Info h5Info; 148 149 @SerializedName("app_info") 150 public RepaymentAppInfo appInfo; 151 152 @SerializedName("miniprogram_info") 153 public RepaymentMiniprogramInfo miniprogramInfo; 154 } 155 156 public static class RepaymentPrepayResponse { 157 @SerializedName("prepay_id") 158 public String prepayId; 159 160 @SerializedName("h5_url") 161 public String h5Url; 162 } 163 164 public static class RepaymentSubOrder { 165 @SerializedName("mchid") 166 public String mchid; 167 168 @SerializedName("sub_mchid") 169 public String subMchid; 170 171 @SerializedName("out_trade_no") 172 public String outTradeNo; 173 174 @SerializedName("amount") 175 public RepaymentAmountInfo amount; 176 177 @SerializedName("attach") 178 public String attach; 179 180 @SerializedName("description") 181 public String description; 182 183 @SerializedName("settle_info") 184 public RepaymentSettleInfo settleInfo; 185 } 186 187 public static class RepaymentH5Info { 188 @SerializedName("combine_appid") 189 public String combineAppid; 190 191 @SerializedName("payer_client_ip") 192 public String payerClientIp; 193 194 @SerializedName("type") 195 public String type; 196 197 @SerializedName("app_name") 198 public String appName; 199 200 @SerializedName("app_url") 201 public String appUrl; 202 203 @SerializedName("bundle_id") 204 public String bundleId; 205 206 @SerializedName("package_name") 207 public String packageName; 208 } 209 210 public static class RepaymentAppInfo { 211 @SerializedName("combine_appid") 212 public String combineAppid; 213 } 214 215 public static class RepaymentMiniprogramInfo { 216 @SerializedName("combine_appid") 217 public String combineAppid; 218 219 @SerializedName("openid") 220 public String openid; 221 } 222 223 public static class RepaymentAmountInfo { 224 @SerializedName("total_amount") 225 public Long totalAmount; 226 227 @SerializedName("currency") 228 public String currency; 229 } 230 231 public static class RepaymentSettleInfo { 232 @SerializedName("profit_sharing") 233 public Boolean profitSharing; 234 235 @SerializedName("subsidy_amount") 236 public Long subsidyAmount; 237 } 238 239} 240
需配合微信支付工具库 wxpay_utility 使用,请参考Go
1package main 2 3import ( 4 "bytes" 5 "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 6 "encoding/json" 7 "fmt" 8 "net/http" 9 "net/url" 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 := &RepaymentPrepayRequest{ 28 CombineOutTradeNo: wxpay_utility.String("1217752501201407033233368018"), 29 CombineMchid: wxpay_utility.String("1230000109"), 30 SubOrders: []RepaymentSubOrder{RepaymentSubOrder{ 31 Mchid: wxpay_utility.String("1230000109"), 32 SubMchid: wxpay_utility.String("1900000109"), 33 OutTradeNo: wxpay_utility.String("20150806125346"), 34 Amount: &RepaymentAmountInfo{ 35 TotalAmount: wxpay_utility.Int64(10), 36 Currency: wxpay_utility.String("CNY"), 37 }, 38 Attach: wxpay_utility.String("深圳分店"), 39 Description: wxpay_utility.String("某某放心借"), 40 SettleInfo: &RepaymentSettleInfo{ 41 ProfitSharing: wxpay_utility.Bool(false), 42 SubsidyAmount: wxpay_utility.Int64(10), 43 }, 44 }}, 45 TimeExpire: wxpay_utility.Time(time.Now()), 46 NotifyUrl: wxpay_utility.String("https://yourapp.com/notify"), 47 H5Info: &RepaymentH5Info{ 48 CombineAppid: wxpay_utility.String("wxd678efh567hg6787"), 49 PayerClientIp: wxpay_utility.String("14.23.150.211"), 50 Type: wxpay_utility.String("iOS"), 51 AppName: wxpay_utility.String("王者荣耀"), 52 AppUrl: wxpay_utility.String("https://pay.qq.com"), 53 BundleId: wxpay_utility.String("com.tencent.wzryiOS"), 54 PackageName: wxpay_utility.String("com.tencent.tmgp.sgame"), 55 }, 56 AppInfo: &RepaymentAppInfo{ 57 CombineAppid: wxpay_utility.String("wxd678efh567hg6787"), 58 }, 59 MiniprogramInfo: &RepaymentMiniprogramInfo{ 60 CombineAppid: wxpay_utility.String("wxd678efh567hg6787"), 61 Openid: wxpay_utility.String("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o "), 62 }, 63 } 64 65 response, err := RepaymentPrepay(config, request) 66 if err != nil { 67 fmt.Printf("请求失败: %+v\n", err) 68 // TODO: 请求失败,根据状态码执行不同的处理 69 return 70 } 71 72 // TODO: 请求成功,继续业务逻辑 73 fmt.Printf("请求成功: %+v\n", response) 74} 75 76func RepaymentPrepay(config *wxpay_utility.MchConfig, request *RepaymentPrepayRequest) (response *RepaymentPrepayResponse, err error) { 77 const ( 78 host = "https://api.mch.weixin.qq.com" 79 method = "POST" 80 path = "/v3/repayment/combine-transactions/partner/prepay" 81 ) 82 83 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path)) 84 if err != nil { 85 return nil, err 86 } 87 reqBody, err := json.Marshal(request) 88 if err != nil { 89 return nil, err 90 } 91 httpRequest, err := http.NewRequest(method, reqUrl.String(), bytes.NewReader(reqBody)) 92 if err != nil { 93 return nil, err 94 } 95 httpRequest.Header.Set("Accept", "application/json") 96 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId()) 97 httpRequest.Header.Set("Content-Type", "application/json") 98 authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), reqBody) 99 if err != nil { 100 return nil, err 101 } 102 httpRequest.Header.Set("Authorization", authorization) 103 104 client := &http.Client{} 105 httpResponse, err := client.Do(httpRequest) 106 if err != nil { 107 return nil, err 108 } 109 respBody, err := wxpay_utility.ExtractResponseBody(httpResponse) 110 if err != nil { 111 return nil, err 112 } 113 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 { 114 // 2XX 成功,验证应答签名 115 err = wxpay_utility.ValidateResponse( 116 config.WechatPayPublicKeyId(), 117 config.WechatPayPublicKey(), 118 &httpResponse.Header, 119 respBody, 120 ) 121 if err != nil { 122 return nil, err 123 } 124 response := &RepaymentPrepayResponse{} 125 if err := json.Unmarshal(respBody, response); err != nil { 126 return nil, err 127 } 128 129 return response, nil 130 } else { 131 return nil, wxpay_utility.NewApiException( 132 httpResponse.StatusCode, 133 httpResponse.Header, 134 respBody, 135 ) 136 } 137} 138 139type RepaymentPrepayRequest struct { 140 CombineOutTradeNo *string `json:"combine_out_trade_no,omitempty"` 141 CombineMchid *string `json:"combine_mchid,omitempty"` 142 SubOrders []RepaymentSubOrder `json:"sub_orders,omitempty"` 143 TimeExpire *time.Time `json:"time_expire,omitempty"` 144 NotifyUrl *string `json:"notify_url,omitempty"` 145 H5Info *RepaymentH5Info `json:"h5_info,omitempty"` 146 AppInfo *RepaymentAppInfo `json:"app_info,omitempty"` 147 MiniprogramInfo *RepaymentMiniprogramInfo `json:"miniprogram_info,omitempty"` 148} 149 150type RepaymentPrepayResponse struct { 151 PrepayId *string `json:"prepay_id,omitempty"` 152 H5Url *string `json:"h5_url,omitempty"` 153} 154 155type RepaymentSubOrder struct { 156 Mchid *string `json:"mchid,omitempty"` 157 SubMchid *string `json:"sub_mchid,omitempty"` 158 OutTradeNo *string `json:"out_trade_no,omitempty"` 159 Amount *RepaymentAmountInfo `json:"amount,omitempty"` 160 Attach *string `json:"attach,omitempty"` 161 Description *string `json:"description,omitempty"` 162 SettleInfo *RepaymentSettleInfo `json:"settle_info,omitempty"` 163} 164 165type RepaymentH5Info struct { 166 CombineAppid *string `json:"combine_appid,omitempty"` 167 PayerClientIp *string `json:"payer_client_ip,omitempty"` 168 Type *string `json:"type,omitempty"` 169 AppName *string `json:"app_name,omitempty"` 170 AppUrl *string `json:"app_url,omitempty"` 171 BundleId *string `json:"bundle_id,omitempty"` 172 PackageName *string `json:"package_name,omitempty"` 173} 174 175type RepaymentAppInfo struct { 176 CombineAppid *string `json:"combine_appid,omitempty"` 177} 178 179type RepaymentMiniprogramInfo struct { 180 CombineAppid *string `json:"combine_appid,omitempty"` 181 Openid *string `json:"openid,omitempty"` 182} 183 184type RepaymentAmountInfo struct { 185 TotalAmount *int64 `json:"total_amount,omitempty"` 186 Currency *string `json:"currency,omitempty"` 187} 188 189type RepaymentSettleInfo struct { 190 ProfitSharing *bool `json:"profit_sharing,omitempty"` 191 SubsidyAmount *int64 `json:"subsidy_amount,omitempty"` 192} 193
应答参数
200 OK
prepay_id 选填 string(64)
【预支付交易会话标识】 微信生成的预支付会话标识,数字和字母组成,用于小程序调起支付、app调起支付、微信内网页调起支付,该值有效期为2小时。
h5_url 选填 string(512)
【支付跳转链接】 H5调起支付跳转链接,链接有效期为5分钟,下单时传入H5调起支付信息时返回该字段
应答示例
200 OK
1{ 2 "prepay_id" : "wx201410272009395522657a690389285100", 3 "h5_url" : "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx2016121516420242444321ca0631331346&package=1405458241" 4} 5
错误码
以下是本接口返回的错误码列表。详细错误码规则,请参考微信支付接口规则-错误码和错误提示

