Skip to content

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

Notifications You must be signed in to change notification settings

daihere1993/cordova-plugin-xpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
    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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published