Appearance
微信小程序支付
公共参数
参数 | 类型 | 是否必填 | 最大长度 | 描述 | 示例 |
---|---|---|---|---|---|
mch_no | String | 是 | 32 | 商户号 | 2014072300007148 |
method | String | 是 | 128 | 接口名称,如果是小程序跳小程序用前者(trade.wechat.mini.pay),如果是 APP 或者 H5 跳小程序用后者(trade.wechat.mini.h5.pay) | trade.wechat.mini.pay 或 trade.wechat.mini.h5.pay |
charset | String | 是 | 10 | 调用的接口版本,固定为:utf-8 | utf-8 |
sign_type | String | 是 | 10 | 商户生成签名字符串所使用的签名算法类型,目前支持 RSA | RSA |
sign | String | 是 | 344 | 商户请求参数的签名串 | 详见示例 |
timestamp | String | 是 | 19 | 发送请求的时间,格式"yyyy-MM-dd HH:mm:ss" | 2014-07-24 03:07:50 |
version | String | 是 | 3 | 调用的接口版本,固定为:1.0 | 1.0 |
notify_url | String | 否 | 200 | 异步通知地址,200 个字符之内 | http://localhost/notify.html |
return_url | String | 否 | 200 | 同步跳转地址,200 个字符之内 | http://localhost/return.html |
biz_content | String | 是 | 业务参数 |
业务参数
参数 | 类型 | 是否必填 | 最大长度 | 描述 | 示例 |
---|---|---|---|---|---|
out_trade_no | String | 必选 | 64 | 商户订单号。由商家自定义,需保证在商户端不重复。 | 20150320010101001 |
total_amount | Number | 必选 | 11 | 订单总金额。单位为元,精确到小数点后两位。 | 88.88 |
subject | String | 必选 | 256 | 订单标题。 | Iphone6 16G |
client_ip | String | 必选 | 32 | 客户端 IPV4 地址。 | 127.0.0.1 |
app_id | String | 否 | 128 | 商户小程序 appid | wxsssdfsfsfsdfsdf |
divide_type | String | 可选 | 25 | 用户如果要手动分账,参数固定传 DELAY_SETTLE | DELAY_SETTLE |
payer_id | String | 否 | 128 | 支付用户的 openid | asdasdasdasd |
使用 APP 或者 H5 跳转小程序的返回参数
参数 | 类型 | 描述 |
---|---|---|
code | Int | 20000 |
message | String | success |
qrcode_url | String | 跳转(APP,H5 场景)或者扫码(PC 场景,慎用,可能不跳转)链接 |
sign | String | 签名字符串 |
使用小程序跳转小程序的返回参数
参数 | 类型 | 描述 |
---|---|---|
code | Int | 20000 |
message | String | success |
path | String | 小程序跳转页面链接,带参数 |
appId | String | 小程序 appid |
basePath | String | 小程序跳转页面链接 |
orgId | String | 小程序需要的 orgId |
sign | String | 签名字符串 |
示例代码
json
H5 和 APP 场景的小程序返回结果如下:
{
"code": 20000,
"msg": "success",
"out_trade_no": "ff222222202222",
"total_amount": "38.88",
"trade_no": 595648781137768448,
"qrcode_url": "https://img.yeepay.com/fe-resources/html/redirectTest.html?redirectUrl=https%3A%2F%2Fyunkaifa-1gn6er8qec364121-1317582238.tcloudbaseapp.com%2Fjump-mp-v1.html%3Fstate%3D42496438-ceed-4cf5-8152-9562658188d2%26customerNo%3D10089645136%26goodsName%3D%25E6%25B5%258B%25E8%25AF%25951%26customerRequestNo%3D595648781137768448%26orderAmount%3D38.88",
"sign": "BQfLxHlw+G8i0KoYt4sMNcLFSyj+YR5xb54zUQCAEyj5zmJIr0gKqRhdxz8ORhR9vyygKvLqBDMVomSQjRQ7alkN/OlQs9rKi+w3diBCEBtqHDqDcawpiZaSFkIHDmoaP+Wj2u5NtVs1rTr1Wa8PtZ1kLQaAe6ipDD24J8Qczv7pbU0LqeGYkGqA+ckk4aGnyw7oSIU6gnpZCBvd7fP3QrhNZ7sAFm2kLmQKcmNIfwNy3uVXvdonhuJ+p7uk8aHlJw8XhgSYFEte2Z1jERmLfJYgQSP8xm/Y+xuPHjNNbHJqlgpzg2ke0IuXl7QleV5zd/yV3Hu8DumXSMoz+5EglQ=="
}