Razorpay TypeScript SDK
[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
All New Razorpay Webhook Handler
Introducing RazorWebhook
, a wrapper class for simplifying Webhooks actions for Razorpay Webhook Payload. You can now focus more on your core logic than managing event types.
// --------------------// Webhooks// -------------------- ;; /// Setup your custom handler actionswh.handler.subscriptionActivated =; wh.handler.subscriptionUpdated =; ;
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)
;
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; // Additional neat functionality than official nodejs SDK// now even store instances of all services// with neat instance classes;payment.transfer;
Every resource method returns a promise.
instance.payments .all .then .catch;
TODO
- Add detailed documentation to ease implementation curve.
- Further simplification of the data interfaces and introduce a failure response interface.
- Improve validation for params required and ignore which are params not.
Development
npm install
Build
npm run build
Release
- Switch to
master
branch. Make sure you have the latest changes in the local master - Update the
CHANGELOG.md
& bump the version inpackage.json
- Commit
- Tag the release & push to Github
- Create a release on GitHub using the website with more details about the release
- 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.