egg-plugin-wechat-pay

3.1.3 • Public • Published

egg-plugin-wechat-pay

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-plugin-wechat-pay --save

Usage

// {app_root}/config/plugin.js
exports.eggPluginWechatPay = {
  enable: true,
  package: 'egg-plugin-wechat-pay',
};

Configuration

// {app_root}/config/config.default.js
exports.eggPluginWechatPay = {
};

see config/config.default.js for more detail.

Example

使用方式

  • 在config/config.default.js中增加配置
{
    "wechatPay": {
 
        // 是否实例化支付业务类 默认false, 只有为true,该实例才能出现在应用类中
        'appPay': {
            appId: ''
            'key': '',
            'mchId': '',
            'pfx': '', // 允许传Buffer或者证书的本地路径
        }, // APP 支付
        'litePay': {
            appId: ''
        }, // 小程序支付
        'pubPay': {
            appId: ''
        }, // 公众号支付
        'pubQrPay': {
            appId: ''
        }, // 扫码支付
        'pubScanPay': {
            appId: ''
        }, // 刷卡支付
        'wapPay': {
            appId: ''
        }, // H5 支付
    }
}
  • 就可以使用 类似 app.appPay 调用实例

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-plugin-wechat-pay

Weekly Downloads

1

Version

3.1.3

License

MIT

Unpacked Size

8.69 kB

Total Files

6

Last publish

Collaborators

  • lixiang920531