简要描述:
接口版本:
版本号 |
制定人 |
制定日期 |
备注 |
1.0.0 |
kevin |
2019-09-19 |
购买套餐下单接口 |
请求URL:
请求方式:
请求头:
参数名 |
是否必须 |
类型 |
说明 |
Content-Type |
是 |
string |
|
Content-MD5 |
是 |
string |
|
请求参数:
参数名 |
是否必须 |
类型 |
说明 |
token |
是 |
string |
用户凭证 |
package_id |
是 |
int |
套餐id |
req_method |
是 |
string |
h5=h5/公众号 ,small=小程序,app=app支付 |
wx_openid |
是 |
string |
公众号openid,app不用 |
pay_method |
是 |
string |
支付发送 WeChat=微信 ,Alipay=支付宝 |
返回示例:
正确时返回(例子):
//微信h5支付或者小程序
{
"msg": "请求成功",
"code": 200,
"icon": 1,
"time": 2000,
"data": {
"appId": "wx045139a6c8c33a4e",
"timeStamp": "1568961678",
"nonceStr": "401rp3ulu8a2pduxxpw4x2zuy9eh0iuj",
"package": "prepay_id=wx1816175708158210839e633e1942110400",
"signType": "MD5",
"paySign": "D5CD79928683C9A4569AEB1D5DE13215"
},
"url": null
}
//微信app支付
{
"msg": "请求成功",
"code": 200,
"icon": 1,
"time": 2000,
"data": {
"appid": "wxd65a13300ecaae03",
"partnerid": "1523813651",
"prepayid": "wx23135523797435758c6b1c0c1872304000",
"package": "Sign=WXPay",
"noncestr": "ac1qcw0g1mz61mnci7efvv1lcytjoqny",
"timestamp": "1577080522",
"sign": "CF9E33DA925BA843AE68FBCC6F869821"
},
"url": null
}
//支付宝
{
"msg": "请求成功",
"code": 200,
"icon": 1,
"time": 2000,
"data": "alipay_sdk=alipay-sdk-php-easyalipay-20190926&app_id=2019121169879357&biz_content=%7B%22body%22%3A%22%E5%9C%A8%E7%BA%BF%E6%94%AF%E4%BB%98%22%2C%22subject%22%3A+%22%E5%9C%A8%E7%BA%BF%E6%94%AF%E4%BB%98%22%2C%22out_trade_no%22%3A+%2258091577080616446%22%2C%22timeout_express%22%3A+%2260m%22%2C%22total_amount%22%3A+%22288.00%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay¬ify_url=http%3A%2F%2Fcha.com%2Fmodule%2Fapi%2Fchachebaobei%2Fpay%2FaliPayCallback&sign_type=RSA2×tamp=2019-12-23+13%3A56%3A56&version=1.0&sign=WGrZ4cyoxNqQITUEj0OOclhs4SsRYbQtDKTz2Xs5%2BoxauYSXaHYtBJqO1vtLx2oNVf8uzThyv63KyA7cKUWSMLezncTqC1s5CHO%2BgS5oASNKOx05f0pl8%2BNzO9uW3FOUD5uuNE54rOA6EScaBZoIi43MZNffGTr%2BkrbO6UxuYO4lQ2cbRxz5CpUHkYFrRdGx9xlvdSHZrqYyyKAVIcawmdtgEjSnRHPZS0hP1erntRwbdLaYL3LNmidbo3FvI2L7hVa1W7iuzryNDP%2BEcfjBeBivH3HVZCO4XyaPPH9Ko5%2FXtdXTsk174pXV%2FRYE9kzAi3JRbAcaJZ72uXepz9RnzQ%3D%3D",
"url": null
}
错误时返回(例子):
{
"status": 40000,
"msg": "下单失败",
"data": []
}
返回参数说明:
备注:
- 更多返回错误代码请看下面
200 请求成功
400 请求失败
文档更新时间: 2019-12-23 14:08 作者:kevin