This libs has wrap service for Stripe API and web endpoints (with Swagger) to call Stripe API Uses in nestjs projects.
Include Webhooks listeners and Stripe Event enums.
npm install --save @valor/nestjs-stripe
yarn add @valor/nestjs-stripe
There are two ways use StripeModule
in application
StripeModule.forRootAsync({
useFactory: (config: AppConfigService) => ({
apiKey: config.values.stripe.apiKey,
webHookSignature: config.values.stripe.webHookSignature,
successUrl: 'http://localhost:3333/purchase-success',
cancelUrl: 'http://localhost:3333/card',
currency: 'usd'
}),
inject: [AppConfigService]
}, AppAuthGuard)
StripeModule.forRoot({
apiKey: process.env.STRIPE_API_KEY,
webHookSignature: process.env.STRIPE_WEBHOOK_SIGNATURE,
successUrl: 'http://localhost:3333/purchase-success',
cancelUrl: 'http://localhost:3333/card',
currency: 'usd'
}, AppAuthGuard)