使用的插件參照地址:https://github.com/xu-li/cordova-plugin-wechat;(這裡包含微信登錄,微信分享和微信支付) 插件安裝 cordova plugin add cordova-plugin-wechat --variable wechatappid=YOU ...
使用的插件參照地址:https://github.com/xu-li/cordova-plugin-wechat;(這裡包含微信登錄,微信分享和微信支付)
插件安裝 cordova plugin add cordova-plugin-wechat --variable wechatappid=YOUR_WECHAT_APPID;
使用方法:
var params = {
partnerid: '10000100', // merchant id
prepayid: 'wx201411101639507cbf6ffd8b0779950874', // prepay id
noncestr: '1add1a30ac87aa2db72f57a2375d8fec', // nonce
timestamp: '1439531364', // timestamp
sign: '0CB01533B8C1EF103065174F50BCA001', // signed string
};
Wechat.sendPaymentRequest(params, function () {
alert("Success");
}, function (reason) {
alert("Failed: " + reason);
});
其中一些參數規範和格式參見
微信開發官方文檔 https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_1