Skip to content

Latest commit

 

History

History
52 lines (44 loc) · 816 Bytes

File metadata and controls

52 lines (44 loc) · 816 Bytes

面包多支付 SDK

支持nestjs

Usage

const pay = new MbdPay('appId', 'appKey');

pay.aliPay({
  url: '',
  description: '',
  amount_total: 0,
});

MbdPay

Nestjs

@Module({
  imports: [
     MbdPayModule.forRoot({
      appId: 'xxxxxx',
      appKey: 'xxxxxx',
    }),
    MbdPayModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory(config: ConfigService) {
        return {
          appId: config.get('mbd.appId'),
          appKey: config.get('mbd.appKey'),
        };
      },
    }),
  ]
})
export class AppModule {
  constructor(
    private readonly mbdPayService: MbdPayService,
  ) {
    mbdPayService.client.aliPay({
      url: '',
      description: '',
      amount_total: 0,
    });
  }
}