nest-wechatpay-node-v3
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

nest-wechatpay-node-v3

安装

npm install nest-wechatpay-node-v3

npm install wechatpay-node-v3

注册

import { WeChatPayModule } from 'nest-wechatpay-node-v3';

@Module({
  imports: [
    WeChatPayModule.registerAsync({
      useFactory: async () => {
        return {
          appid: '直连商户申请的公众号或移动应用appid',
          mchid: '商户号',
          publicKey: fs.readFileSync('./apiclient_cert.pem'), // 公钥
          privateKey: fs.readFileSync('./apiclient_key.pem'), // 秘钥
        };
      },
    }),
  ],
})
export class AppModule {}

// 或者动态配置 useFactory: async (configService: ConfigService)

交互

import WxPay from 'wechatpay-node-v3';

import { WECHAT_PAY_MANAGER } from 'nest-wechatpay-node-v3';

constructor(@Inject(WECHAT_PAY_MANAGER) private wxPay: WxPay) {}

使用

const res = await this.wxPay.batches_transfer();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    157
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    157
  • 1.0.1
    4
  • 1.0.0
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i nest-wechatpay-node-v3

Weekly Downloads

161

Version

1.0.2

License

ISC

Unpacked Size

14.7 kB

Total Files

14

Last publish

Collaborators

  • wjc_0412