微信支付统一下单后
先调用shop/order/add接口,再调用shop/order/getpaymentparams接口,接口都没有报错。
shop/order/add请求数据
{
"create_time": "2023-01-11 11:55:34",
"type": 0,
"out_order_id": "SN2301111137FCC731",
"openid": "o7JCY4mHVxJ541Nj3I0Q4aqt_2DA",
"path": "packageA/member/orderdetail/orderdetail?order_id=1304&orderType=shop",
"scene": "1089",
"out_user_id": 1065,
"order_detail": {
"product_infos": [{
"out_product_id": 1759,
"out_sku_id": 0,
"product_cnt": 1,
"sale_price": "1",
"sku_real_price": "1",
"path": "packageA/detail_v2/detail_v2?id=1759",
"title": "新款漱口杯仙人掌创意牙刷杯子",
"head_img": "https://saas.fryb.cn/static/upload/images/5/2023/01/d0f16a76c7ce8ce59d9719521802fb56.jpg"
}],
"pay_info": {
"pay_method_type": 0,
"prepay_id": "wx1111553453437846729b58af407c920000",
"prepay_time": "2023-01-11 11:55:34"
},
"price_info": {
"order_price": "1",
"freight": "0",
"discounted_price": 0,
"additional_price": "0",
"additional_remarks": "附加费用"
}
},
"delivery_detail": {
"delivery_type": 1
},
"fund_type": 1,
"expire_time": 1673495734,
"address_info": {
"receiver_name": "测试",
"detailed_address": "北京市 北京市 东城区 测试地址",
"tel_number": "13711111111"
}
}
shop/order/add返回数据(这部分有自己封装过,但是data数据是跟返回的一致的)
{
"result": 1,
"msg": "获取成功",
"data": {
"state": 1,
"data": {
"create_time": "2023-01-11 11:55:34",
"type": 0,
"out_order_id": "SN2301111137FCC731",
"openid": "o7JCY4mHVxJ541Nj3I0Q4aqt_2DA",
"path": "packageA/member/orderdetail/orderdetail?order_id=1304&orderType=shop",
"scene": "1089",
"out_user_id": 1065,
"order_detail": {
"product_infos": [{
"out_product_id": 1759,
"out_sku_id": 0,
"product_cnt": 1,
"sale_price": "1",
"sku_real_price": "1",
"path": "packageA/detail_v2/detail_v2?id=1759",
"title": "新款漱口杯仙人掌创意牙刷杯子",
"head_img": "https://saas.fryb.cn/static/upload/images/5/2023/01/d0f16a76c7ce8ce59d9719521802fb56.jpg"
}],
"pay_info": {
"pay_method_type": 0,
"prepay_id": "wx1111553453437846729b58af407c920000",
"prepay_time": "2023-01-11 11:55:34"
},
"price_info": {
"order_price": "1",
"freight": "0",
"discounted_price": 0,
"additional_price": "0",
"additional_remarks": "附加费用"
}
},
"delivery_detail": {
"delivery_type": 1
},
"fund_type": 1,
"expire_time": 1673495734,
"address_info": {
"receiver_name": "测试",
"detailed_address": "北京>市 北京市 东城区 测试地址",
"tel_number": "13711111111"
}
},
"payment_params": {
"timeStamp": "1673409336",
"nonceStr": "A2vq5M-vQYEjTYtk9wOp5eRhMDq3HJ4oIPZmiWQ2DPrReqKinHOS2Ojmo1KNQmG-",
"package": "pay_info=A2vq5M-vQYEjTYtk9wOp5eRhMDq3HJ4oIPZmiWQ2DPrReqKinHOS2Ojmo1KNQmG-",
"signType": "RSA",
"paySign": "A2vq5M-vQYEjTYtk9wOp5eRhMDq3HJ4oIPZmiWQ2DPrReqKinHOS2Ojmo1KNQmG-",
"timestamp": "1673409336"
}
}
}
shop/order/getpaymentparams接口返回数据
{
"appId": "wxc22e8d8460c95a93",
"nonceStr": "A2vq5M-vQYEjTYtk9wOp5eRhMDq3HJ4oIPZmiWQ2DPrReqKinHOS2Ojmo1KNQmG-",
"package": "pay_info=A2vq5M-vQYEjTYtk9wOp5eRhMDq3HJ4oIPZmiWQ2DPrReqKinHOS2Ojmo1KNQmG-",
"signType": "RSA",
"paySign": "A2vq5M-vQYEjTYtk9wOp5eRhMDq3HJ4oIPZmiWQ2DPrReqKinHOS2Ojmo1KNQmG-",
"timestamp": "1673409336",
"prepayId": "wx1111553453437846729b58af407c920000",
"timeStamp": "1673409336"
}
调起收银台的api
requestPayment