egg-plugin-wechat-pay

[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][down

Usage no npm install needed!

<script type="module">
  import eggPluginWechatPay from 'https://cdn.skypack.dev/egg-plugin-wechat-pay';
</script>

README

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