web支付总结

微信支付:
 
1、公众号支付 (即微信内部h5调起支付,服务端提供所需要的签名、时间戳等,前端调用微信jssdk WeixinJSBridge,详细见文档:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
 
2、h5支付(非微信内置浏览器中,后端提供weburl,调起微信app支付,前端提供returnUrl支付成功回调,详细见文档:https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=15_4)
 
3、在app内部h5支付
 
需要webview中手动设置referer,如(
Map<string,string> extraHeaders = new HashMap<string,string>();
extraHeaders.put("Referer", "商户申请H5时提交的授权域名");//例如 http://www.baidu.com ))
 
支付宝h5支付:
 
后端返回支付中间页,前端显示并提交,详细见文档:https://docs.open.alipay.com/203/105288/
 
const div = document.createElement('div')
div.innerHTML = data.body
document.body.appendChild(div)
document.forms[0].submit()

 

 

posted @ 2018-09-26 15:22  娜嚒妮  阅读(438)  评论(0编辑  收藏  举报