From a35e37a069701d32010b66b6c1a902f72a721318 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 22 Feb 2023 19:30:25 +0530 Subject: [PATCH 1/3] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ad7d6625..216e9ae9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "razorpay", - "version": "2.8.5", + "version": "2.8.6", "description": "Official Node SDK for Razorpay API", "main": "dist/razorpay", "typings": "dist/razorpay", From 00e8eb51862be743e0dbba956f935a9a9bca9890 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 28 Dec 2023 13:33:50 +0530 Subject: [PATCH 2/3] update iin entity --- documents/iins.md | 106 ++++++++++++++++++++++++++++++++++++++++++ lib/resources/iins.js | 7 +++ lib/types/iins.d.ts | 13 ++++++ 3 files changed, 126 insertions(+) create mode 100644 documents/iins.md diff --git a/documents/iins.md b/documents/iins.md new file mode 100644 index 00000000..5f6e9f9d --- /dev/null +++ b/documents/iins.md @@ -0,0 +1,106 @@ +### Iin + +### Token IIN API + +```js +var tokenIin = "412345"; +instance.iins.fetch(tokenIin) +``` + +**Parameters:** + +| Name | Type | Description | +|------------|--------|-----------------------------------| +| tokenIin* | string | The token IIN. | + +**Response:** +```json +{ + "iin": "412345", + "entity": "iin", + "network": "Visa", + "type": "credit", + "sub_type": "business", + "issuer_code": "HDFC", + "issuer_name": "HDFC Bank Ltd", + "international": false, + "is_tokenized": true, + "card_iin": "411111", + "emi":{ + "available": true + }, + "recurring": { + "available": true + }, + "authentication_types": [ + { + "type":"3ds" + }, + { + "type":"otp" + } + ] +} +``` +------------------------------------------------------------------------------------------------------- + +### Fetch All IINs Supporting Native OTP + +```js +var param = {"flow": "otp"} +instance.iins.all(param) +``` + +**Response:** +```json +{ + "count": 24, + "iins": [ + "512967", + "180005", + "401704", + "401806", + "123456", + "411111", + "123512967", + "180012305", + "401123704" + ] +} +``` +------------------------------------------------------------------------------------------------------- + +### Fetch All IINs with Business Sub-type + +```js +var param = {"sub_type": "business"} +instance.iins.all(param) +``` + +**Response:** +```json +{ + "count": 24, + "iins": [ + "512967", + "180005", + "401704", + "401806", + "607389", + "652203", + "414367", + "787878", + "123456", + "411111", + "123512967", + "180012305", + "401123704" + ] +} +``` +------------------------------------------------------------------------------------------------------- + +**PN: * indicates mandatory fields** +
+
+**For reference click [here](https://razorpay.com/docs/api/payments/cards/iin-api/#iin-entity)** \ No newline at end of file diff --git a/lib/resources/iins.js b/lib/resources/iins.js index a6dc7a9c..add028c3 100644 --- a/lib/resources/iins.js +++ b/lib/resources/iins.js @@ -10,5 +10,12 @@ module.exports = function (api) { url: `${BASE_URL}/${tokenIin}`, }, callback); }, + + all(params = {}, callback) { + return api.get({ + url: `${BASE_URL}/list`, + data: params + }, callback) + }, } } \ No newline at end of file diff --git a/lib/types/iins.d.ts b/lib/types/iins.d.ts index f19cae9e..d1ce7517 100644 --- a/lib/types/iins.d.ts +++ b/lib/types/iins.d.ts @@ -93,6 +93,13 @@ export declare namespace Iins { | 'consumer' | 'business' | 'unknown' + + type ListType = {flow: string;} | {sub_type: string;} + + interface RazorpayIinList { + count: number; + iins : string[]; + } } declare function iins(api: any): { @@ -104,6 +111,12 @@ declare function iins(api: any): { */ fetch(tokenIin: string): Promise fetch(tokenIin: string, callback: (err: INormalizeError | null, data: Iins.RazorpayIin) => void): void; + /** + * Fetch all IINs supporting `native otp` or `business sub-type` + * + * @param params - Check [doc](https://razorpay.com/docs/api/payments/cards/iin-api/#fetch-all-iins-supporting-native-otp) for required params + */ + all(params: Iins.ListType): Promise } export default iins \ No newline at end of file From c306169913ed764aaa3faf31db234d9085bdf268 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 7 May 2024 18:19:26 +0530 Subject: [PATCH 3/3] update type --- lib/types/iins.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/types/iins.d.ts b/lib/types/iins.d.ts index d1ce7517..0c8f970c 100644 --- a/lib/types/iins.d.ts +++ b/lib/types/iins.d.ts @@ -117,6 +117,7 @@ declare function iins(api: any): { * @param params - Check [doc](https://razorpay.com/docs/api/payments/cards/iin-api/#fetch-all-iins-supporting-native-otp) for required params */ all(params: Iins.ListType): Promise + all(params: Iins.ListType, callback: (err: INormalizeError | null, data: Iins.RazorpayIinList) => void): void; } export default iins \ No newline at end of file