H5预签约
更新时间:2025.12.05服务商调用本接口预先指定签约信息,进行预签约。在完成预签约后,服务商会得到对应的预签约码(presign_token)。服务商H5再携带预签约码参数拉起微信客户端的签约页面,让用户完成签约。签约完成后,将返回服务商H5。
若用户同意本次流程,则微信支付会通过服务商指定的回调地址通知签约结果;若用户未同意或者流程执行失败,则不通知签约结果。
在发起签约后,服务商签约协议号不能再重复使用,包括签约失败的协议、签约成功后解约的协议及签约成功生效中的协议。服务商可通过查询协议接口确认服务商签约协议号是否已经使用。
注意:服务商获取到的预签约码有效期为10分钟。10分钟后,预签约码失效。此时,如果再携带预签约ID跳转到微信客户端进行签约,则将报错。
需按照notify_url填写注意事项规范填写。
接口说明
支持商户:【普通服务商】
请求方式:【POST】/v3/credit-repayment/partner/contracts/h5-presign
请求域名:【主域名】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
Wechatpay-Serial 必填 string
【微信支付公钥ID】或【微信支付平台证书序列号】 请求参数中的敏感字段,需要使用微信支付公钥加密(推荐),请参考获取微信支付公钥ID说明以及微信支付公钥加密敏感信息指引;也可以使用微信支付平台证书公钥加密,参考获取平台证书序列号、平台证书加密敏感信息指引
body 包体参数
appid 必填 string(32)
【商户AppID】 商户在微信申请的公众号或移动应用AppID,与服务商商户号绑定。可参考服务商模式开发必要参数说明
plan_id 必填 string(64)
【模板ID】 信贷还款模板ID; 在服务商平台上成功申请模板后系统自动分配的
out_contract_code 必填 string(64)
【服务商签约协议号】 服务商的签约协议号。服务商需保证唯一性。只能是数字、大小写字母的组合
display_name 必填 string(64)
【用户展示名称】 签约用户的名称,用于签约页面展示;需使用用户姓名掩码。掩码规则:只保留最后一个字符,除最后一个字符外全部字符(包括“.”等符号)均使用“*”替代;如姓名长度大于4个字符,统一用3个“*”+1位明文展示,如***G
contract_notify_url 必填 string(256)
【签约结果通知地址】 接收微信支付异步通知回调地址,通知URL必须为HTTPS且可直接可访问的URL,不能携带参数。参考回调通知注意事项
repayment_day 选填 integer
【还款日】 每月还款的日期
repayment_amount_limit 必填 string
【还款金额上限】 每次最多还款金额;单位:分
sub_mchid 选填 string(32)
【子商户号】 微信支付分配的商户号,服务商商户号与子商户号存在父子关系
sub_appid 选填 string(32)
【子商户AppID】 与子商户号绑定的AppID。可参考服务商模式开发必要参数说明
real_identity 必填 object
【用户实名信息】 商家可选择指定用户实名信息。指定用户实名信息后,微信支付系统会校验商户指定的用户实名信息跟用户在微信支付侧的实名信息是否一致。信息一致时才可进行签约;若信息不一致,不能进行本次签约。注:因实名信息不一致导致无法进行签约,微信支付将不会通知签约结果,也不会产生协议或订单信息。
| 属性 | |
identity_type 必填 string 【实名验证类型】 实名验证类型 可选取值
identity_id 必填 string(512) 【加密后的自然人证件号码】 经过加密后的自然人证件号码信息 real_name 必填 string(512) 【加密后的自然人姓名】 经过加密后的自然人姓名信息 |
trade_info 选填 object
【交易信息】 若希望在进行签约后立即进行首次还款,则必须传入交易信息
| 属性 | |
out_trade_no 必填 string 【商户侧交易单号】 商户系统的交易单号,只能是数字、大小写字母。需要保证在同一个商户号下唯一 deduct_amount 必填 string 【还款金额】 单位:分 description 选填 string 【产品描述】 对产品信息的描述,将展示在用户的支付凭证、用户账单详情中。服务商需传递能真实代表产品信息的描述 attach 选填 string 【商户数据包】 商户在预约还款时可传入自定义数据包,该数据对用户不可见,用于存储商户自定义信息。查询API和支付通知中原样返回,并且该字段还会体现在交易账单。 notify_url 选填 string 【商户回调地址】 商户接收还款结果通知的地址 |
jump_info 选填 object
【跳转控制信息】 指定相关参数,可控制签约完成后跳转的路径。
| 属性 | |
jump_appid 选填 string(32) 【签约完后要跳转到的应用AppID】 当商户已经申请H5签约完成后返回App的权限且指定跳转的应用AppID,签约完成后将返回该AppID对应的App应用。 |
请求示例
POST
1curl -X POST \ 2 https://api.mch.weixin.qq.com/v3/credit-repayment/partner/contracts/h5-presign \ 3 -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \ 4 -H "Accept: application/json" \ 5 -H "Wechatpay-Serial: 5157F09EFDC096DE15EBE81A47057A7232F1B8E1" \ 6 -H "Content-Type: application/json" \ 7 -d '{ 8 "appid" : "wxd678efh567hg6787", 9 "plan_id" : "WxCreditRepaymentPlan12345678", 10 "out_contract_code" : "WxCreditRepayment20200910100000", 11 "display_name" : "*明", 12 "contract_notify_url" : "https://yourapp.com/notify", 13 "repayment_day" : 1, 14 "repayment_amount_limit" : "10000", 15 "sub_mchid" : "1000000109", 16 "sub_appid" : "wxcbda96de0b165489", 17 "real_identity" : { 18 "identity_type" : "REAL_IDENTITY_TYPE_ID_CARD", 19 "identity_id" : "1axtI9EZUr0343c89xQznxau+cRWPKP4YhVAoj/mEoNSgJh0nvuqQJ1cdXZHGUzyBjOtuLeVq+OLOaWGUScSM8+QLBk+kOK8QyR1TUo44YrmIl5KkjWLa3dpNJt+nIkpN1e7yr2mxO9LGqJdeQXDCHvOiUTK6lnAVxWY0ZrF4OQFmHqOCvqTaF3VxD5a8AT3gxyayF04IJSfPV0NheZvWFBHIUeRPf1/WQmJ/wXu2MfAuESB0dLBglT85i0Rws2GopaTUNiBuJBHdg01bR+YZvSYv8EJPyxuyYVh5bg/wSotNTYnVp13OUzMBKu25yOW5+RnunesXwq9ogPnSj7EDA==", 20 "real_name" : "OEimkKuua8igpd+0YDgqF2Z61leeGD7x87j3PhzsBhAK+/lltXENEOf6ThgV7niChzIpDujIpefE2JFZCJFurf6IV5rxNWBbjFeHYyUGAbf8zDx2Wbi7y7BGjApltIhsxAk+LhQ648Kcw4FMidL/79Gh3nHUfSGX+nEl3gtNi24Ilt8Vu0MMXhA1suDzlpbNDDrYnAhb1eeMziSu8jW7lDouwJXjGh9zgFPUuTxfOpteJIZSy8HWR+QPugdXBNouEezDPN8kojKbJHRtjaBJY3n3agkXShI5yvnc+DCYM+4VgNWZpTx9D0w3KAylJPKAAluYMzj4VXzZurjpruDg2A==" 21 }, 22 "trade_info" : { 23 "out_trade_no" : "1217752501201407033233368018", 24 "deduct_amount" : "10000", 25 "description" : "信贷还款", 26 "attach" : "备注信息", 27 "notify_url" : "https://www.test.com" 28 }, 29 "jump_info" : { 30 "jump_appid" : "example_jump_appid" 31 } 32 }' 33
需配合微信支付工具库 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 * H5预签约 24 */ 25public class PartnerPresignContractByH5 { 26 private static String HOST = "https://api.mch.weixin.qq.com"; 27 private static String METHOD = "POST"; 28 private static String PATH = "/v3/credit-repayment/partner/contracts/h5-presign"; 29 30 public static void main(String[] args) { 31 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 32 PartnerPresignContractByH5 client = new PartnerPresignContractByH5( 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 PresignContractByH5Request request = new PresignContractByH5Request(); 41 request.appid = "wxd678efh567hg6787"; 42 request.planId = "WxCreditRepaymentPlan12345678"; 43 request.outContractCode = "WxCreditRepayment20200910100000"; 44 request.displayName = "*明"; 45 request.contractNotifyUrl = "https://yourapp.com/notify"; 46 request.repaymentDay = 1L; 47 request.repaymentAmountLimit = "10000"; 48 request.subMchid = "1000000109"; 49 request.subAppid = "wxcbda96de0b165489"; 50 request.realIdentity = new RealIdentity(); 51 request.realIdentity.identityType = RealIdentityType.REAL_IDENTITY_TYPE_ID_CARD; 52 request.realIdentity.identityId = client.encrypt("identity_id"); 53 request.realIdentity.realName = client.encrypt("real_name"); 54 request.tradeInfo = new TradeInfo(); 55 request.tradeInfo.outTradeNo = "1217752501201407033233368018"; 56 request.tradeInfo.deductAmount = "10000"; 57 request.tradeInfo.description = "信贷还款"; 58 request.tradeInfo.attach = "备注信息"; 59 request.tradeInfo.notifyUrl = "https://www.test.com"; 60 request.jumpInfo = new JumpInfo(); 61 request.jumpInfo.jumpAppid = "example_jump_appid"; 62 try { 63 PresignContractByH5Response response = client.run(request); 64 // TODO: 请求成功,继续业务逻辑 65 System.out.println(response); 66 } catch (WXPayUtility.ApiException e) { 67 // TODO: 请求失败,根据状态码执行不同的逻辑 68 e.printStackTrace(); 69 } 70 } 71 72 public PresignContractByH5Response run(PresignContractByH5Request request) { 73 String uri = PATH; 74 String reqBody = WXPayUtility.toJson(request); 75 76 Request.Builder reqBuilder = new Request.Builder().url(HOST + uri); 77 reqBuilder.addHeader("Accept", "application/json"); 78 reqBuilder.addHeader("Wechatpay-Serial", wechatPayPublicKeyId); 79 reqBuilder.addHeader("Authorization", WXPayUtility.buildAuthorization(mchid, certificateSerialNo,privateKey, METHOD, uri, reqBody)); 80 reqBuilder.addHeader("Content-Type", "application/json"); 81 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), reqBody); 82 reqBuilder.method(METHOD, requestBody); 83 Request httpRequest = reqBuilder.build(); 84 85 // 发送HTTP请求 86 OkHttpClient client = new OkHttpClient.Builder().build(); 87 try (Response httpResponse = client.newCall(httpRequest).execute()) { 88 String respBody = WXPayUtility.extractBody(httpResponse); 89 if (httpResponse.code() >= 200 && httpResponse.code() < 300) { 90 // 2XX 成功,验证应答签名 91 WXPayUtility.validateResponse(this.wechatPayPublicKeyId, this.wechatPayPublicKey, 92 httpResponse.headers(), respBody); 93 94 // 从HTTP应答报文构建返回数据 95 return WXPayUtility.fromJson(respBody, PresignContractByH5Response.class); 96 } else { 97 throw new WXPayUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers()); 98 } 99 } catch (IOException e) { 100 throw new UncheckedIOException("Sending request to " + uri + " failed.", e); 101 } 102 } 103 104 private final String mchid; 105 private final String certificateSerialNo; 106 private final PrivateKey privateKey; 107 private final String wechatPayPublicKeyId; 108 private final PublicKey wechatPayPublicKey; 109 110 public PartnerPresignContractByH5(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) { 111 this.mchid = mchid; 112 this.certificateSerialNo = certificateSerialNo; 113 this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath); 114 this.wechatPayPublicKeyId = wechatPayPublicKeyId; 115 this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath); 116 } 117 118 public String encrypt(String plainText) { 119 return WXPayUtility.encrypt(this.wechatPayPublicKey, plainText); 120 } 121 122 public static class PresignContractByH5Request { 123 @SerializedName("appid") 124 public String appid; 125 126 @SerializedName("plan_id") 127 public String planId; 128 129 @SerializedName("out_contract_code") 130 public String outContractCode; 131 132 @SerializedName("display_name") 133 public String displayName; 134 135 @SerializedName("contract_notify_url") 136 public String contractNotifyUrl; 137 138 @SerializedName("repayment_day") 139 public Long repaymentDay; 140 141 @SerializedName("repayment_amount_limit") 142 public String repaymentAmountLimit; 143 144 @SerializedName("sub_mchid") 145 public String subMchid; 146 147 @SerializedName("sub_appid") 148 public String subAppid; 149 150 @SerializedName("real_identity") 151 public RealIdentity realIdentity; 152 153 @SerializedName("trade_info") 154 public TradeInfo tradeInfo; 155 156 @SerializedName("jump_info") 157 public JumpInfo jumpInfo; 158 } 159 160 public static class PresignContractByH5Response { 161 @SerializedName("redirect_url") 162 public String redirectUrl; 163 } 164 165 public static class RealIdentity { 166 @SerializedName("identity_type") 167 public RealIdentityType identityType; 168 169 @SerializedName("identity_id") 170 public String identityId; 171 172 @SerializedName("real_name") 173 public String realName; 174 } 175 176 public static class TradeInfo { 177 @SerializedName("out_trade_no") 178 public String outTradeNo; 179 180 @SerializedName("deduct_amount") 181 public String deductAmount; 182 183 @SerializedName("description") 184 public String description; 185 186 @SerializedName("attach") 187 public String attach; 188 189 @SerializedName("notify_url") 190 public String notifyUrl; 191 } 192 193 public static class JumpInfo { 194 @SerializedName("jump_appid") 195 public String jumpAppid; 196 } 197 198 public enum RealIdentityType { 199 @SerializedName("REAL_IDENTITY_TYPE_INVALID") 200 REAL_IDENTITY_TYPE_INVALID, 201 @SerializedName("REAL_IDENTITY_TYPE_ID_CARD") 202 REAL_IDENTITY_TYPE_ID_CARD 203 } 204 205} 206
需配合微信支付工具库 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) 11 12func main() { 13 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 14 config, err := wxpay_utility.CreateMchConfig( 15 "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 16 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 17 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 18 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 19 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 20 ) 21 if err != nil { 22 fmt.Println(err) 23 return 24 } 25 26 request := &PresignContractByH5Request{ 27 Appid: wxpay_utility.String("wxd678efh567hg6787"), 28 PlanId: wxpay_utility.String("WxCreditRepaymentPlan12345678"), 29 OutContractCode: wxpay_utility.String("WxCreditRepayment20200910100000"), 30 DisplayName: wxpay_utility.String("*明"), 31 ContractNotifyUrl: wxpay_utility.String("https://yourapp.com/notify"), 32 RepaymentDay: wxpay_utility.Int64(1), 33 RepaymentAmountLimit: wxpay_utility.String("10000"), 34 SubMchid: wxpay_utility.String("1000000109"), 35 SubAppid: wxpay_utility.String("wxcbda96de0b165489"), 36 RealIdentity: &RealIdentity{ 37 IdentityType: REALIDENTITYTYPE_REAL_IDENTITY_TYPE_ID_CARD.Ptr(), 38 IdentityId: wxpay_utility.String("1axtI9EZUr0343c89xQznxau+cRWPKP4YhVAoj/mEoNSgJh0nvuqQJ1cdXZHGUzyBjOtuLeVq+OLOaWGUScSM8+QLBk+kOK8QyR1TUo44YrmIl5KkjWLa3dpNJt+nIkpN1e7yr2mxO9LGqJdeQXDCHvOiUTK6lnAVxWY0ZrF4OQFmHqOCvqTaF3VxD5a8AT3gxyayF04IJSfPV0NheZvWFBHIUeRPf1/WQmJ/wXu2MfAuESB0dLBglT85i0Rws2GopaTUNiBuJBHdg01bR+YZvSYv8EJPyxuyYVh5bg/wSotNTYnVp13OUzMBKu25yOW5+RnunesXwq9ogPnSj7EDA=="), /*请传入wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 39 RealName: wxpay_utility.String("OEimkKuua8igpd+0YDgqF2Z61leeGD7x87j3PhzsBhAK+/lltXENEOf6ThgV7niChzIpDujIpefE2JFZCJFurf6IV5rxNWBbjFeHYyUGAbf8zDx2Wbi7y7BGjApltIhsxAk+LhQ648Kcw4FMidL/79Gh3nHUfSGX+nEl3gtNi24Ilt8Vu0MMXhA1suDzlpbNDDrYnAhb1eeMziSu8jW7lDouwJXjGh9zgFPUuTxfOpteJIZSy8HWR+QPugdXBNouEezDPN8kojKbJHRtjaBJY3n3agkXShI5yvnc+DCYM+4VgNWZpTx9D0w3KAylJPKAAluYMzj4VXzZurjpruDg2A=="), /*请传入wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 40 }, 41 TradeInfo: &TradeInfo{ 42 OutTradeNo: wxpay_utility.String("1217752501201407033233368018"), 43 DeductAmount: wxpay_utility.String("10000"), 44 Description: wxpay_utility.String("信贷还款"), 45 Attach: wxpay_utility.String("备注信息"), 46 NotifyUrl: wxpay_utility.String("https://www.test.com"), 47 }, 48 JumpInfo: &JumpInfo{ 49 JumpAppid: wxpay_utility.String("example_jump_appid"), 50 }, 51 } 52 53 response, err := PartnerPresignContractByH5(config, request) 54 if err != nil { 55 fmt.Printf("请求失败: %+v\n", err) 56 // TODO: 请求失败,根据状态码执行不同的处理 57 return 58 } 59 60 // TODO: 请求成功,继续业务逻辑 61 fmt.Printf("请求成功: %+v\n", response) 62} 63 64func PartnerPresignContractByH5(config *wxpay_utility.MchConfig, request *PresignContractByH5Request) (response *PresignContractByH5Response, err error) { 65 const ( 66 host = "https://api.mch.weixin.qq.com" 67 method = "POST" 68 path = "/v3/credit-repayment/partner/contracts/h5-presign" 69 ) 70 71 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path)) 72 if err != nil { 73 return nil, err 74 } 75 reqBody, err := json.Marshal(request) 76 if err != nil { 77 return nil, err 78 } 79 httpRequest, err := http.NewRequest(method, reqUrl.String(), bytes.NewReader(reqBody)) 80 if err != nil { 81 return nil, err 82 } 83 httpRequest.Header.Set("Accept", "application/json") 84 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId()) 85 httpRequest.Header.Set("Content-Type", "application/json") 86 authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), reqBody) 87 if err != nil { 88 return nil, err 89 } 90 httpRequest.Header.Set("Authorization", authorization) 91 92 client := &http.Client{} 93 httpResponse, err := client.Do(httpRequest) 94 if err != nil { 95 return nil, err 96 } 97 respBody, err := wxpay_utility.ExtractResponseBody(httpResponse) 98 if err != nil { 99 return nil, err 100 } 101 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 { 102 // 2XX 成功,验证应答签名 103 err = wxpay_utility.ValidateResponse( 104 config.WechatPayPublicKeyId(), 105 config.WechatPayPublicKey(), 106 &httpResponse.Header, 107 respBody, 108 ) 109 if err != nil { 110 return nil, err 111 } 112 response := &PresignContractByH5Response{} 113 if err := json.Unmarshal(respBody, response); err != nil { 114 return nil, err 115 } 116 117 return response, nil 118 } else { 119 return nil, wxpay_utility.NewApiException( 120 httpResponse.StatusCode, 121 httpResponse.Header, 122 respBody, 123 ) 124 } 125} 126 127type PresignContractByH5Request struct { 128 Appid *string `json:"appid,omitempty"` 129 PlanId *string `json:"plan_id,omitempty"` 130 OutContractCode *string `json:"out_contract_code,omitempty"` 131 DisplayName *string `json:"display_name,omitempty"` 132 ContractNotifyUrl *string `json:"contract_notify_url,omitempty"` 133 RepaymentDay *int64 `json:"repayment_day,omitempty"` 134 RepaymentAmountLimit *string `json:"repayment_amount_limit,omitempty"` 135 SubMchid *string `json:"sub_mchid,omitempty"` 136 SubAppid *string `json:"sub_appid,omitempty"` 137 RealIdentity *RealIdentity `json:"real_identity,omitempty"` 138 TradeInfo *TradeInfo `json:"trade_info,omitempty"` 139 JumpInfo *JumpInfo `json:"jump_info,omitempty"` 140} 141 142type PresignContractByH5Response struct { 143 RedirectUrl *string `json:"redirect_url,omitempty"` 144} 145 146type RealIdentity struct { 147 IdentityType *RealIdentityType `json:"identity_type,omitempty"` 148 IdentityId *string `json:"identity_id,omitempty"` 149 RealName *string `json:"real_name,omitempty"` 150} 151 152type TradeInfo struct { 153 OutTradeNo *string `json:"out_trade_no,omitempty"` 154 DeductAmount *string `json:"deduct_amount,omitempty"` 155 Description *string `json:"description,omitempty"` 156 Attach *string `json:"attach,omitempty"` 157 NotifyUrl *string `json:"notify_url,omitempty"` 158} 159 160type JumpInfo struct { 161 JumpAppid *string `json:"jump_appid,omitempty"` 162} 163 164type RealIdentityType string 165 166func (e RealIdentityType) Ptr() *RealIdentityType { 167 return &e 168} 169 170const ( 171 REALIDENTITYTYPE_REAL_IDENTITY_TYPE_INVALID RealIdentityType = "REAL_IDENTITY_TYPE_INVALID" 172 REALIDENTITYTYPE_REAL_IDENTITY_TYPE_ID_CARD RealIdentityType = "REAL_IDENTITY_TYPE_ID_CARD" 173) 174
应答参数
200 OK
redirect_url 必填 string(64)
【拉起微信支付签约页的URL】 用于浏览器拉起微信支付客户端签约页面的URL
应答示例
200 OK
1{ 2 "redirect_url" : "https://www.xxx.com/xxx?presign_token=wx12334" 3} 4
错误码
以下是本接口返回的错误码列表。详细错误码规则,请参考微信支付接口规则-错误码和错误提示
状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
400 | INVALID_REQUEST | HTTP 请求不符合微信支付 APIv3 接口规则 | 请参阅 接口规则 |
401 | SIGN_ERROR | 验证不通过 | 请参阅 签名常见问题 |
500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |

