Socket
Socket
Sign inDemoInstall

razorpay-typescript

Package Overview
Dependencies
52
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    razorpay-typescript

Unofficial TypeScript based Node.js SDK for Razorpay API.


Version published
Maintainers
1
Created

Changelog

Source

1.0.6 - 2020-04-21

  • [Bug] Build issue resolved

Readme

Source

Razorpay TypeScript SDK

npm Build Status

[UNOFFICIAL] TypeScript based Node.js SDK for Razorpay API.

Read up here for getting started and understanding the payment flow with Razorpay: https://docs.razorpay.com/docs/getting-started

Installation

npm i razorpay-typescript

Documentation

Documentation of Razorpay's API and their usage is available at https://docs.razorpay.com

Basic Usage

Instantiate the razorpay instance with key_id & key_secret. You can obtain the keys from the dashboard app (https://dashboard.razorpay.com/#/app/keys)

const instance: Razorpay = new Razorpay({
  authKey: {
      key_id: 'YOUR_KEY_ID',
      key_secret: 'YOUR_KEY_SECRET', 
  },
  headers: {... Your Headers ...},
});

The resources can be accessed via the instance. All the methods invocations follows the namespaced signature

// API signature
// {razorpayInstance}.{resourceName}.{methodName}(resourceId [, params])
// Build with neat response interfaces

// example
const paymentDetails: IRazorPaymentId = await instance.payments.fetch(paymentId);

// Additional neat functionality than official nodejs SDK
// now even store instances of all services
// with neat instance classes
const payment: RazorPayment = instance.payments.payment('your_payementId');
payment.transfer([
  {
      account: 'acc_7HGyrafdeQDGfX',
      amount: 100,
      currency: 'INR'
  }
]);

Every resource method returns a promise.

instance.payments
  .all({
    from: '2016-08-01',
    to: '2016-08-20',
  })
  .then(response => {
    // handle success
  })
  .catch(error => {
    // handle error
  });

Supported Resources


Development

npm install

Testing

npm test

Release

  1. Switch to master branch. Make sure you have the latest changes in the local master
  2. Update the CHANGELOG.md & bump the version in package.json
  3. Commit
  4. Tag the release & push to Github
  5. Create a release on GitHub using the website with more details about the release
  6. Publish to npm with npm publish command

Licence

MIT Licensed. See LICENSE.txt for more details


Razorpay [Unofficial SDK for TypeScript] is a Knoxpo original.

Keywords

FAQs

Last updated on 21 Apr 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc