egg-alipay-plugin

1.0.1 • Public • Published

egg-alipay-plugin

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

Install

$ npm i egg-alipay-plugin --save

Usage

// {app_root}/config/plugin.js
exports.alipayPlugin = {
  enable: true,
  package: 'egg-alipay-plugin',
};

Configuration

// {app_root}/config/config.default.js
exports.alipayPlugin = {
  appId: '2016123456789012', // 应用id
  privateKey: fs.readFileSync('./private-key.pem', 'ascii'), // 私钥
  alipayPublicKey: fs.readFileSync('./public-key.pem', 'ascii'), // 公钥(支付宝公钥,需要对结果验签时候必填)
  encryptKey: '', // AES密钥(非必填)
  gateway:'', // 支付宝网关地址 ,沙箱环境下使用时需要修改
  useCert: false, // 是否使用证书模式
  alipayRootCertPath: path.join(__dirname, '../fixtures/alipayRootCert.crt'), // 证书模式下才有效
  appCertPath: path.join(__dirname, '../fixtures/appCertPublicKey.crt'),// 证书模式下才有效
  alipayPublicCertPath: path.join(__dirname, '../fixtures/alipayCertPublicKey_RSA2.crt'),// 证书模式下才有效
};

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

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-alipay-plugin

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

6.55 kB

Total Files

5

Last publish

Collaborators

  • bigboxs