Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.9.6 - 2025-02-24
feat: Added support for access token based authentication mechanism
- Added oauth APIs (getAuthURL, getAccessToken, refreshToken, revokeToken)
- Added support for onboarding signature generation
- Doc updated

## 2.9.5 - 2024-10-23
fix: Cancel subscription `cancelAtCycleEnd` now supports both `boolean` and `0/1` values as expected.
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ var instance = new Razorpay({
});
```

### 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/.

```js
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

```js
Expand Down Expand Up @@ -130,6 +141,8 @@ instance.payments.all(

- [Document](documents/documents.md)

- [oAuthTokenClient](documents/oAuthTokenClient.md)

---

## Development
Expand Down
4 changes: 2 additions & 2 deletions documents/oAuthTokenClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
### Generate Authorize Url
```js

const OAuthTokenClient = require("./dist/oAuthTokenClient");
const { generateOnboardingSignature } = require("./dist/utils/razorpay-utils")
const OAuthTokenClient = require("razorpay/dist/oAuthTokenClient")
const { generateOnboardingSignature } = require("razorpay/dist/utils/razorpay-utils")

// Initialize client
let oAuth = new OAuthTokenClient();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razorpay",
"version": "2.9.5",
"version": "2.9.6",
"description": "Official Node SDK for Razorpay API",
"main": "dist/razorpay",
"typings": "dist/razorpay",
Expand Down