1.0.3 • Published 3 years ago

@sjnprjl/nestjs-stripe v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Installation

npm install @sjnprjl/nestjs-stripe

Install stripe.

npm install stripe

Example

// app.module.ts
import { Module } from '@nestjs/common';
import { StripeModule } from '@sjnprjl/nestjs-stripe';
@Module({
  imports: [
    // ...
    StripeModule.forRoot({
      apiKey: 'your-secret-key',
      options: {
        apiVersion: '2022-08-01',
      },
    }),
    // ...
  ],
  // ...
})
export class AppModule {}

Now you can inject the stripe client into your services .

// app.service.ts
import { Inject, Injectable } from '@nestjs/common';
import { STRIPE_TOKEN } from '@sjnprjl/nestjs-stripe'; // provider token
import Stripe from 'stripe';

@Injectable()
export class AppService {
  constructor(@Inject(STRIPE_TOKEN) private stripeClient: Stripe) {}
}

Contributing

I am sure there are many things that this package must include. So, feel free to contribute to this repo for I am not so good coder.

License

Distributed under the MIT License.

Copyright @ 2022 Sujan Parajuli

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago