avatar

wechat miniprogram PHP

first need get wechat user openid

demo:wechat miniprogram get user openid

PHP code Github

wechat miniprogram
Javascript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
wx.request({
url: 'order url',
data: {
openid: openid.data.openid,
payAmount: '0.01',
orderName: 'goods',
},
success: function(results) {
let tempArr = (results.data);
wx.requestPayment({
timeStamp: '' + tempArr.timeStamp,
nonceStr: tempArr.nonceStr,
package: tempArr.package,
signType: tempArr.signType,
paySign: tempArr.paySign,
success(res) {
// payment success
},
})
},
});

PHP code Github

Author: Qin
Link: https://qinhaolei.com/posts/65027/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Reward
  • WechatPay
    WechatPay
  • AliPay
    AliPay
  • Bitcoin
    Bitcoin

Comment