使用服务商模式,服务商appid:wx1010a36d3025a16e,小程序 appid: wx9a63f9cfa365a915
统一下单请求:
{
"appid":"wx1010a36d3025a16e",
"body":"测试支付",
"mch_id":"1602614783",
"nonce_str":"2020102810213425588NO",
"notify_url":"XXXXXXX",
"openid":"oiHuo6UwgcGiAeoGe1sfkbBupA78",
"out_trade_no":"2020102810213425588NO",
"profit_sharing":"Y",
"spbill_create_ip":"120.198.22.66",
"sub_mch_id":"1603656898",
"total_fee":1,
"trade_type":"JSAPI",
"sign":"58E76C007D83D322062255BE91C61FA5"
}
小程序调起支付API:
wx.requestPayment(
{
'timeStamp': '1603852043',
'nonceStr': '2020102810213425588NO',
'package': 'prepay_id=wx28102723273479f7a28c3179341f3c0000',
'signType': 'MD5',
'paySign': '6F49F6F991B27B03D080DF36D38FDF38',
'success':function(res){},
'fail':function(res){},
'complete':function(res){}
})
服务商后台关联了小程序appid
https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_2.shtml
看这个文档
看文档要求必须在特约商户开发配置中将该小程序appid配置成sub_appid,但是小微商户不支持商家平台。要求进入小程序管理,进入小程序后没有可以配置的功能