Socket
Book a DemoInstallSign in
Socket

nestjs-razorpay

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-razorpay

Easy integration for razorpay payment gateway into your nestjs app

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
361
0.84%
Maintainers
1
Weekly downloads
 
Created
Source

About

This package implements a module which can be used to setup and inject Razorpay client instance into your nestjs application.

Installation

yarn add nestjs-razorpay

Getting Started

The simplest way to use nestjs-razorpay is to use RazorpayModule.forRoot

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

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.

License

Distributed under the MIT License. See LICENSE for more information.

FAQs

Package last updated on 08 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts