servbus / cordova-plugin-xpay

💰 This is a app payment cordova-plugin, support wechat payment and alipay temporally.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cordova-plugin-xpay

A cordova plugin about app pay way, suport alipay and wechat.

Features

  • Wechat payment for app.
  • Ali payment for app.

Install

cordova plugin add cordova-plugin-xpay --variable wechatappid=YOUT_WECHATAPPID --variable aliappid=YOUT_ALIPAYAPPID

or

ionic plugin add cordova-plugin-xpay --variable wechatappid=YOUT_WECHATAPPID --variable aliappid=YOUT_ALIPAYAPPID

Usage

Wechat payment

var params = {
    type: 'wechat',
    appId: 'wx0123456789', // appid
    partnerid: '10000100', // merchant id
    prepayid: 'wx201411101639507cbf6ffd8b0779950874', // prepay id
    noncestr: '1add1a30ac87aa2db72f57a2375d8fec', // nonce
    timestamp: '1439531364', // timestamp
    sign: '0CB01533B8C1EF103065174F50BCA001', // signed string
};

xpay(params, function() {
    console.log('success');
}, function (error) {
    console.log(error);
});

Ali payment

var params = {
    type: 'alipay',
    order: 'alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2017062907602740&...', // this string return by back-end
}

xpay(params, function() {
    console.log('success');
}, function (error) {
    console.log(error);
});

Tip

If you just want realize ali and wechat payment in your app, this plugin is enough. If your needs another wechat function, suggest use cordova-plugin-x-alipay and cordova-plugin-wechat.

LICENSE

MIT LICENSE

About

💰 This is a app payment cordova-plugin, support wechat payment and alipay temporally.


Languages

Language:Objective-C 78.2%Language:Java 17.8%Language:JavaScript 4.0%