{"id":22852219,"url":"https://github.com/knoxpo/razorpay-typescript","last_synced_at":"2025-04-30T09:17:32.010Z","repository":{"id":42880595,"uuid":"256306410","full_name":"knoxpo/razorpay-typescript","owner":"knoxpo","description":"Unofficial TypeScript based Node.js SDK for Razorpay API.","archived":false,"fork":false,"pushed_at":"2022-03-26T13:01:43.000Z","size":11941,"stargazers_count":4,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T09:17:21.651Z","etag":null,"topics":["node-sdk","razorpay","razorpay-api","razorpay-typescript","unofficial"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knoxpo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-16T19:10:23.000Z","updated_at":"2025-03-06T06:06:11.000Z","dependencies_parsed_at":"2022-08-27T08:50:29.310Z","dependency_job_id":null,"html_url":"https://github.com/knoxpo/razorpay-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knoxpo%2Frazorpay-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knoxpo%2Frazorpay-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knoxpo%2Frazorpay-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knoxpo%2Frazorpay-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knoxpo","download_url":"https://codeload.github.com/knoxpo/razorpay-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251674590,"owners_count":21625646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["node-sdk","razorpay","razorpay-api","razorpay-typescript","unofficial"],"created_at":"2024-12-13T06:07:31.660Z","updated_at":"2025-04-30T09:17:31.981Z","avatar_url":"https://github.com/knoxpo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Razorpay TypeScript SDK\n\n[![npm](https://img.shields.io/npm/v/razorpay-typescript.svg?maxAge=2592000?style=flat-square)](https://www.npmjs.com/package/razorpay-typescript)\n[![Build Status](https://travis-ci.org/knoxpo/razorpay-typescript.svg?branch=master)](https://travis-ci.org/knoxpo/razorpay-typescript)\n\n**[UNOFFICIAL]** TypeScript based Node.js SDK for [Razorpay API](https://docs.razorpay.com/docs/payments).\n\nRead up here for getting started and understanding the payment flow with Razorpay: \u003chttps://docs.razorpay.com/docs/getting-started\u003e\n\n## Installation\n\n```bash\nnpm i razorpay-typescript\n```\n\n## Documentation\n\nDocumentation of Razorpay's API and their usage is available at \u003chttps://docs.razorpay.com\u003e\n\n### All New Razorpay Webhook Handler\nIntroducing `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.\n```ts\n// --------------------\n// Webhooks\n// --------------------\n\nconst razorpayPayload: IRazorWebHookPayload = {\n  \"entity\":\"event\",\n  \"account_id\":\"acc_BFQ7uQEaa7j2z7\",\n  \"event\":\"subscription.activated\",\n  \"contains\":[\n    \"subscription\"\n  ],\n  \"payload\":{\n    \"subscription\":{\n      \"entity\":{\n        ...Your payload details ...\n      }\n    }\n  },\n  \"created_at\":1567690383\n};\nconst wh: RazorWebhook = new RazorWebhook(razorpayPayload);\n\n\n/// Setup your custom handler actions\nwh.handler.subscriptionActivated = (pl) =\u003e {\n  /// ----- Your logic code.\n  return Promise.resolve();\n};\n\nwh.handler.subscriptionUpdated = (pl) =\u003e {\n  /// ----- Your logic code.\n  return Promise.resolve();\n};\n\nconst execute: Promise\u003cany\u003e = await wh.execute();\n```\n\n### Basic Usage\n\nInstantiate the razorpay instance with `key_id` \u0026 `key_secret`. You can obtain the keys from the dashboard app ([https://dashboard.razorpay.com/#/app/keys](https://dashboard.razorpay.com/#/app/keys))\n\n```ts\nconst instance: Razorpay = new Razorpay({\n  authKey: {\n      key_id: 'YOUR_KEY_ID',\n      key_secret: 'YOUR_KEY_SECRET', \n  },\n  headers: {... Your Headers ...},\n});\n```\n\nThe resources can be accessed via the instance. All the methods invocations follows the namespaced signature\n\n```ts\n// API signature\n// {razorpayInstance}.{resourceName}.{methodName}(resourceId [, params])\n// Build with neat response interfaces\n\n// example\nconst paymentDetails: IRazorPaymentId = await instance.payments.fetch(paymentId);\n\n// Additional neat functionality than official nodejs SDK\n// now even store instances of all services\n// with neat instance classes\nconst payment: RazorPayment = instance.payments.payment('your_payementId');\npayment.transfer([\n  {\n      account: 'acc_7HGyrafdeQDGfX',\n      amount: 100,\n      currency: 'INR'\n  }\n]);\n```\n\nEvery resource method returns a promise.\n\n```ts\ninstance.payments\n  .all({\n    from: '2016-08-01',\n    to: '2016-08-20',\n  })\n  .then(response =\u003e {\n    // handle success\n  })\n  .catch(error =\u003e {\n    // handle error\n  });\n```\n---\n\n## TODO\n 1. Add detailed documentation to ease implementation curve.\n 2. Further simplification of the data interfaces and introduce a failure response interface.\n 3. Improve validation for params required and ignore which are params not.\n\n## Development\n\n```bash\nnpm install\n```\n\n## Build\n\n```bash\nnpm run build\n```\n\n## Release\n\n1.  Switch to `master` branch. Make sure you have the latest changes in the local master\n2.  Update the `CHANGELOG.md` \u0026 bump the version in `package.json`\n3.  Commit\n4.  Tag the release \u0026 push to Github\n5.  Create a release on GitHub using the website with more details about the release\n6.  Publish to npm with `npm publish` command\n\n## Licence\n\nMIT Licensed. See [LICENSE.txt](LICENSE.txt) for more details\n\n\u003chr/\u003e\nRazorpay [Unofficial SDK for TypeScript] is a Knoxpo original.\n\u003cbr/\u003e\n\u003ca href=\"https://knoxpo.com\" target=\"_knoxpo\"\u003e\u003cimg src=\"https://www.knoxpo.com/assets/logo.png\" width=\"80\"\u003e\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknoxpo%2Frazorpay-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknoxpo%2Frazorpay-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknoxpo%2Frazorpay-typescript/lists"}