2.9.6 • Published 4 months ago

razorpay v2.9.6

Weekly downloads
9,404
License
MIT
Repository
github
Last release
4 months ago

Razorpay Node SDK

npm

Official nodejs library 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

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 Razorpay = require('razorpay');

var instance = new Razorpay({
  key_id: 'YOUR_KEY_ID',
  key_secret: 'YOUR_KEY_SECRET',
});

Using Access Token

Instantiate the razorpay instance with access_token. The access_token can be obtained only in case if you are a platform partner. For more information, refer page - https://razorpay.com/docs/partners/platform/.

const Razorpay = require('razorpay');

var instance = new Razorpay({
  "oauthToken": "ACCESS_TOKEN"
})

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

// API signature
// {razorpayInstance}.{resourceName}.{methodName}(resourceId [, params])

// example
instance.payments.fetch(paymentId);

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
  });

If you want to use callbacks instead of promises, every resource method will accept a callback function as a last parameter. The callback functions will behave as Error First Callbacks

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

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

react-native-payment_testreact-native-payment-integratereact-native-payment1react-native-paymentpackagereact-native-payment_integration@bleco/payment-service@everything-registry/sub-chunk-2533sample-next-auth-appnamaste-betango-app-api-middlewarevendure-razorpay-payment-pluginvendure-razorpay-plugin@crystallize/node-service-api-request-handlers@com.xcodeclazz/k8s-common@com.xcodeclazz/monolithic-common@alexjv89/microlight@121cars/common0726reactuni-checkoutunifi-paymentunified-payunify-pay-flexunify-payment-gateway@espotz/common@life-health-emergency/lhe-reusable-backend@microloop/payment-service@sachin2802/common@pushparajunipay/unipay@sourceloop/payment-servicemotion_industryopengig-razorpayone-paynqapayload-razorpaypayment-bridgesb_razorpay_pluginrazor-pay-connector-prodiorazorpay-packagerazorpay-solution-jsrazorpay-functionsrazorpay-api-wrapperprosseddareact-native-payment_library14react-native-payment_library15react-native-payment_library_testreact-native-payment_library_test1react-native-payment_library_test2react-native-payment_library_test3react-native-payment_library_test4react-native-payment_library_test5react-native-payment_library_test6react-native-payment_library_test7react-native-payment_library_test8react-native-payment_library18react-native-payment_library19react-native-payment_library2react-native-payment_library20react-native-payment_library3react-native-payment_library4react-native-payment_library5react-native-payment_library_finalreact-native-payment_library100react-native-payment_library101react-native-payment_library102react-native-payment_library103react-native-payment_library104react-native-payment_library105react-native-payment_library11react-native-payment_libreact-native-payment_libraryreact-native-payment_library1react-native-payment_library10react-native-payment_library12react-native-payment_library13node-paytmpgnextwebnestjs-razorpaynodejs-setupnodepracitisesimova-apimedusa-admin-addressmedusa-razorpay-webhookmedusa-payment-razorpaymedusa-payment-razorpay-poorvika@waradda.com/monolithic-common@zoowee/medusa-payment-razorpaybackend-ecommercechimera-servercreate-express-boiler-appblockwizardbackend-apisespotz-commonsevershop-razorpayfulkrum-embedfulkrum-embed-reactfulkrum-react-json-view@sgftech/payment-razorpay
2.9.6

4 months ago

2.9.5

8 months ago

2.9.4

1 year ago

2.9.3

1 year ago

2.9.0

2 years ago

2.9.2

2 years ago

2.9.1

2 years ago

2.8.5

2 years ago

2.8.6

2 years ago

2.8.4

3 years ago

2.8.3

3 years ago

2.8.2

3 years ago

2.8.1

3 years ago

2.8.0

4 years ago

2.0.7

4 years ago

2.0.6

5 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.7.1

7 years ago

1.7.0

7 years ago

1.6.4

7 years ago

1.6.3

7 years ago

1.6.2

8 years ago

1.6.1

8 years ago

1.6.0

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago