html5 - 微信浏览器支付为什么会有两份文档?
PHP中文网
PHP中文网 2017-04-17 13:44:24
0
2
511

https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6

http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E5.BE.AE.E4.BF.A1.E6.94.AF.E4.BB.98

用哪个?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
刘奇

can be used as a reference, one is a detailed description of the interface, and the other is a summary of parameters. Don't get hung up. I usually read the explanation articles

巴扎黑

The payment directory settings are the same for both.
Page calling, jssdk is more troublesome, the public platform needs to configure the valid domain name of jssdk
Initiating page usage



//[1]引入 https://res.wx.qq.com/open/js/jweixin-1.1.0.js,
//[2]然后就是confing声明
    wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '', // 必填,公众号的唯一标识
timestamp: , // 必填,生成签名的时间戳
nonceStr: '', // 必填,生成签名的随机串
signature: '',// 必填,签名,见附录1
jsApiList: [] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 
});
//[3]最后才是调用
    wx.chooseWXPay({
timestamp: 0, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: '', // 支付签名随机串,不长于 32 位
package: '', // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
signType: '', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: '', // 支付签名
success: function (res) {
    // 支付成功后的回调函数
} });
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!