调用 微信交易组件 生成订单
入参
{
"openid": "xxxxxxx",
"path": "/pages/order.html?out_order_id=20220408000037",
"scene": 10001,
"create_time": "1970-01-20 10:10:01",
"out_order_id": "6052",
"out_user_id": "16737",
"order_detail":
{
"product_infos": [
{
"path": "/goods-module/goods/goods?goods_id=440",
"title": "我的**商品1",
"out_product_id": "440",
"out_sku_id": "638",
"product_cnt": 1,
"sale_price": 100,
"sku_real_price": 100,
"head_img": "http://cmallwap.haday.cn/statics/attachment/goods/2021/9/14/8/42038728.png"
}],
"pay_info":
{
"pay_method_type": 0,
"prepay_id": "wx08150056769645bcbe5b6e837de6df0000",
"prepay_time": "2022-04-08 15:00:56"
},
"price_info":
{
"freight": 0,
"order_price": 100,
"discounted_price": null,
"additional_price": null,
"additional_remarks": null
}
},
"delivery_detail":
{
"delivery_type": 1
},
"address_info":
{
"country": "禅城区",
"province": "广东",
"city": "佛山市",
"town": "城区",
"receiver_name": "333",
"detailed_address": "333",
"tel_number": "15976650325"
},
"fund_type": 0,
"expire_time": 1649487656
}
返回
{"errcode":0,"errmsg":null,"data":{"order_id":3302467084551586304,"out_order_id":"6052","final_price":100,"ticket":"e012ea22-bd18-4f74-8239-49c923c0f659","ticket_expire_time":"2022-04-09 15:00:56"}}
发起 微信交易组件支付
入参
appId: "xxxxxxxxxx"
nonceStr: "1310806797"
package: "prepay_id=wx08153842389323b20b6f94128324500000"
paySign: "904E298DC97C3F878E2B210F29CC4375"
signType: "MD5"
ticket: "e012ea22-bd18-4f74-8239-49c923c0f659"
timeStamp: "1649403522"
wx.requestOrderPayment({
timeStamp: params.timeStamp,
nonceStr: params.nonceStr,
package: params.package,
signType: params.signType,
paySign: params.paySign,
ticket: params.ticket, // 需要新增的 ticket 信息
success: function success(res) {
console.log('success:' + JSON.stringify(res));
paySuccess(res);
},
fail: function fail(res) {
payFail(err);
console.log('fail:' + JSON.stringify(err));
} });
返回
addOrderErrCode: 1010005
errMsg: "requestOrderPayment:fail price_info字段异常,请检查json及字段合法性"
请问 price_info哪里有异常
生成订单你接的是这个add_order_new.html, 这个的话fund_type=0 就会报错,只支持等于1