@ccatto/nest-payments
v1.0.0
Published
Catto Payments - NestJS Stripe SDK wrapper (PaymentIntent, Checkout, Webhooks)
Maintainers
Readme
@ccatto/nest-payments
NestJS dynamic module wrapping the Stripe SDK. Provides services for PaymentIntent creation, Checkout Sessions, and webhook verification.
Install
npm install @ccatto/nest-payments
# or
yarn add @ccatto/nest-paymentsQuick Start
import { Module } from '@nestjs/common';
import { CattoPaymentsModule } from '@ccatto/nest-payments';
@Module({
imports: [
CattoPaymentsModule.forRoot({
secretKey: process.env.STRIPE_SECRET_KEY,
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
}),
],
})
export class AppModule {}Inject the service in your controllers or providers:
import { CattoPaymentsService } from '@ccatto/nest-payments';
@Injectable()
export class OrderService {
constructor(private readonly payments: CattoPaymentsService) {}
async createPayment(amount: number, currency: string) {
return this.payments.createPaymentIntent({ amount, currency });
}
}Peer Dependencies
| Package | Version | Required |
| --- | --- | --- |
| @nestjs/common | >=10.0.0 | Yes |
| @nestjs/core | >=10.0.0 | Yes |
| reflect-metadata | >=0.1.0 | Yes |
License
MIT
