Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lambrohan/nestjs-razorpay
Easily integrate razorpay into your nestjs backend
https://github.com/lambrohan/nestjs-razorpay
nestjs razorpay
Last synced: 2 days ago
JSON representation
Easily integrate razorpay into your nestjs backend
- Host: GitHub
- URL: https://github.com/lambrohan/nestjs-razorpay
- Owner: lambrohan
- License: mit
- Created: 2021-03-17T10:42:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-08T03:46:58.000Z (over 1 year ago)
- Last Synced: 2025-01-17T10:43:24.144Z (25 days ago)
- Topics: nestjs, razorpay
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nestjs-razorpay
- Size: 308 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About
This package implements a module which can be used to setup and inject Razorpay client instance into your nestjs application.
## Installation
```bash
yarn add nestjs-razorpay
```## Getting Started
The simplest way to use `nestjs-razorpay` is to use `RazorpayModule.forRoot`
```typescript
import { Module } from '@nestjs-common';
import { RazorpayModule } from 'nestjs-razorpay';@Module({
imports: [
RazorpayModule.forRoot({
key_id: 'razorpay_key_id',
key_secret: 'razorpay_key_secret',
}),
],
})
export class AppModule {}
```use `@InjectRazorpay()` decorator in any injectables to get a Razorpay client inside class
```typescript
import { Injectable } from '@nestjs/common';
import { InjectRazorpay } from 'nestjs-razorpay';
import * as Razorpay from 'razorpay';@Injectable()
export class TestService {
public constructor(
@InjectRazorpay() private readonly razorpayClient: Razorpay,
) {}
}
```Read more about `node-razorpay` [here](https://github.com/razorpay/razorpay-node).
## License
Distributed under the MIT License. See `LICENSE` for more information.