Comparing version 2.9.3 to 2.9.4
@@ -7,3 +7,3 @@ 'use strict'; | ||
var request = require('request-promise'); | ||
var axios = require('axios').default; | ||
var nodeify = require('./utils/nodeify'); | ||
@@ -41,4 +41,4 @@ | ||
throw { | ||
statusCode: err.statusCode, | ||
error: err.error.error | ||
statusCode: err.response.status, | ||
error: err.response.data.error | ||
}; | ||
@@ -53,8 +53,7 @@ } | ||
this.rq = request.defaults({ | ||
baseUrl: options.hostUrl, | ||
json: true, | ||
this.rq = axios.create({ | ||
baseURL: options.hostUrl, | ||
auth: { | ||
user: options.key_id, | ||
pass: options.key_secret | ||
username: options.key_id, | ||
password: options.key_secret | ||
}, | ||
@@ -73,5 +72,4 @@ headers: Object.assign({ 'User-Agent': options.ua }, getValidHeaders(options.headers)) | ||
value: function get(params, cb) { | ||
return nodeify(this.rq.get({ | ||
url: this.getEntityUrl(params), | ||
qs: params.data | ||
return nodeify(this.rq.get(this.getEntityUrl(params), { | ||
params: params.data | ||
}).catch(normalizeError), cb); | ||
@@ -82,7 +80,3 @@ } | ||
value: function post(params, cb) { | ||
var request = { | ||
url: this.getEntityUrl(params), | ||
body: params.data | ||
}; | ||
return nodeify(this.rq.post(request).catch(normalizeError), cb); | ||
return nodeify(this.rq.post(this.getEntityUrl(params), params.data).catch(normalizeError), cb); | ||
} | ||
@@ -95,7 +89,7 @@ | ||
value: function postFormData(params, cb) { | ||
var request = { | ||
url: this.getEntityUrl(params), | ||
formData: params.formData | ||
}; | ||
return nodeify(this.rq.post(request).catch(normalizeError), cb); | ||
return nodeify(this.rq.post(this.getEntityUrl(params), params.formData, { | ||
'headers': { | ||
'Content-Type': 'multipart/form-data' | ||
} | ||
}).catch(normalizeError), cb); | ||
} | ||
@@ -105,6 +99,3 @@ }, { | ||
value: function put(params, cb) { | ||
return nodeify(this.rq.put({ | ||
url: this.getEntityUrl(params), | ||
body: params.data | ||
}).catch(normalizeError), cb); | ||
return nodeify(this.rq.put(this.getEntityUrl(params), params.data).catch(normalizeError), cb); | ||
} | ||
@@ -114,7 +105,3 @@ }, { | ||
value: function patch(params, cb) { | ||
var request = { | ||
url: this.getEntityUrl(params), | ||
body: params.data | ||
}; | ||
return nodeify(this.rq.patch(request).catch(normalizeError), cb); | ||
return nodeify(this.rq.patch(this.getEntityUrl(params), params.data).catch(normalizeError), cb); | ||
} | ||
@@ -124,5 +111,3 @@ }, { | ||
value: function _delete(params, cb) { | ||
return nodeify(this.rq.delete({ | ||
url: this.getEntityUrl(params) | ||
}).catch(normalizeError), cb); | ||
return nodeify(this.rq.delete(this.getEntityUrl(params)).catch(normalizeError), cb); | ||
} | ||
@@ -129,0 +114,0 @@ }]); |
@@ -25,2 +25,4 @@ import API, { RazorpayHeaders } from './types/api' | ||
import iins from './types/iins' | ||
import documents from './types/documents' | ||
import disputes from './types/disputes' | ||
@@ -148,4 +150,14 @@ interface IRazorpayConfig { | ||
iins: ReturnType<typeof iins> | ||
/** | ||
* Documents Entity | ||
* @see https://razorpay.com/docs/api/documents | ||
*/ | ||
documents: ReturnType<typeof documents> | ||
/** | ||
* Dispute Entity | ||
* @see https://razorpay.com/docs/api/disputes | ||
*/ | ||
disputes: ReturnType<typeof disputes> | ||
} | ||
export = Razorpay |
@@ -74,3 +74,5 @@ 'use strict'; | ||
cards: require('./resources/cards')(this.api), | ||
webhooks: require('./resources/webhooks')(this.api) | ||
webhooks: require('./resources/webhooks')(this.api), | ||
documents: require('./resources/documents')(this.api), | ||
disputes: require('./resources/disputes')(this.api) | ||
}); | ||
@@ -77,0 +79,0 @@ } |
'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
module.exports = function (api) { | ||
@@ -35,6 +39,10 @@ | ||
uploadAccountDoc: function uploadAccountDoc(accountId, params, callback) { | ||
var file = params.file, | ||
rest = _objectWithoutProperties(params, ['file']); | ||
return api.postFormData({ | ||
version: 'v2', | ||
url: BASE_URL + '/' + accountId + '/documents', | ||
formData: params | ||
formData: _extends({ | ||
file: file.value }, rest) | ||
}, callback); | ||
@@ -41,0 +49,0 @@ }, |
@@ -9,7 +9,5 @@ "use strict"; | ||
var Promise = require("promise"), | ||
_require = require('../utils/razorpay-utils'), | ||
var _require = require('../utils/razorpay-utils'), | ||
normalizeDate = _require.normalizeDate; | ||
module.exports = function (api) { | ||
@@ -16,0 +14,0 @@ |
@@ -54,4 +54,26 @@ 'use strict'; | ||
}, callback); | ||
}, | ||
addBankAccount: function addBankAccount(customerId, params, callback) { | ||
return api.post({ | ||
url: '/customers/' + customerId + '/bank_account', | ||
data: params | ||
}, callback); | ||
}, | ||
deleteBankAccount: function deleteBankAccount(customerId, bankId, callback) { | ||
return api.delete({ | ||
url: '/customers/' + customerId + '/bank_account/' + bankId | ||
}, callback); | ||
}, | ||
requestEligibilityCheck: function requestEligibilityCheck(params, callback) { | ||
return api.post({ | ||
url: '/customers/eligibility', | ||
data: params | ||
}, callback); | ||
}, | ||
fetchEligibility: function fetchEligibility(eligibilityId, callback) { | ||
return api.get({ | ||
url: '/customers/eligibility/' + eligibilityId | ||
}, callback); | ||
} | ||
}; | ||
}; |
@@ -12,4 +12,13 @@ 'use strict'; | ||
}, callback); | ||
}, | ||
all: function all() { | ||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var callback = arguments[1]; | ||
return api.get({ | ||
url: BASE_URL + "/list", | ||
data: params | ||
}, callback); | ||
} | ||
}; | ||
}; |
@@ -9,7 +9,5 @@ "use strict"; | ||
var Promise = require("promise"), | ||
_require = require('../utils/razorpay-utils'), | ||
var _require = require('../utils/razorpay-utils'), | ||
normalizeDate = _require.normalizeDate; | ||
module.exports = function invoicesApi(api) { | ||
@@ -16,0 +14,0 @@ |
@@ -111,4 +111,18 @@ 'use strict'; | ||
}, callback); | ||
}, | ||
viewRtoReview: function viewRtoReview(orderId, callback) { | ||
return api.post({ | ||
url: '/orders/' + orderId + '/rto_review' | ||
}, callback); | ||
}, | ||
editFulfillment: function editFulfillment(orderId) { | ||
var param = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var callback = arguments[2]; | ||
return api.post({ | ||
url: '/orders/' + orderId + '/fulfillment', | ||
data: param | ||
}); | ||
} | ||
}; | ||
}; |
@@ -9,8 +9,5 @@ "use strict"; | ||
var Promise = require("promise"), | ||
_require = require('../utils/razorpay-utils'), | ||
normalizeDate = _require.normalizeDate, | ||
normalizeNotes = _require.normalizeNotes; | ||
var _require = require('../utils/razorpay-utils'), | ||
normalizeDate = _require.normalizeDate; | ||
module.exports = function paymentLinkApi(api) { | ||
@@ -17,0 +14,0 @@ |
@@ -7,4 +7,2 @@ 'use strict'; | ||
var Promise = require("promise"); | ||
var _require = require('../utils/razorpay-utils'), | ||
@@ -11,0 +9,0 @@ normalizeDate = _require.normalizeDate; |
@@ -9,7 +9,5 @@ "use strict"; | ||
var Promise = require("promise"), | ||
_require = require('../utils/razorpay-utils'), | ||
var _require = require('../utils/razorpay-utils'), | ||
normalizeDate = _require.normalizeDate; | ||
module.exports = function plansApi(api) { | ||
@@ -16,0 +14,0 @@ |
'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
module.exports = function (api) { | ||
@@ -35,6 +39,10 @@ | ||
uploadStakeholderDoc: function uploadStakeholderDoc(accountId, stakeholderId, params, callback) { | ||
var file = params.file, | ||
rest = _objectWithoutProperties(params, ['file']); | ||
return api.postFormData({ | ||
version: 'v2', | ||
url: BASE_URL + '/' + accountId + '/stakeholders/' + stakeholderId + '/documents', | ||
formData: params | ||
formData: _extends({ | ||
file: file.value }, rest) | ||
}, callback); | ||
@@ -41,0 +49,0 @@ }, |
@@ -9,7 +9,5 @@ "use strict"; | ||
var Promise = require("promise"), | ||
_require = require('../utils/razorpay-utils'), | ||
var _require = require('../utils/razorpay-utils'), | ||
normalizeDate = _require.normalizeDate; | ||
module.exports = function subscriptionsApi(api) { | ||
@@ -16,0 +14,0 @@ |
@@ -7,4 +7,2 @@ "use strict"; | ||
var Promise = require("promise"); | ||
var _require = require('../utils/razorpay-utils'), | ||
@@ -27,3 +25,3 @@ normalizeDate = _require.normalizeDate, | ||
skip = params.skip, | ||
otherParams = _objectWithoutProperties(params, ["from", "to", "count", "skip"]); | ||
otherParams = _objectWithoutProperties(params, ['from', 'to', 'count', 'skip']); | ||
@@ -60,3 +58,3 @@ var url = BASE_URL; | ||
var url = BASE_URL + "/" + virtualAccountId; | ||
var url = BASE_URL + '/' + virtualAccountId; | ||
@@ -84,3 +82,3 @@ return api.get({ | ||
return api.post({ | ||
url: BASE_URL + "/" + virtualAccountId + "/close" | ||
url: BASE_URL + '/' + virtualAccountId + '/close' | ||
}, callback); | ||
@@ -95,3 +93,3 @@ }, | ||
var url = BASE_URL + "/" + virtualAccountId + "/payments"; | ||
var url = BASE_URL + '/' + virtualAccountId + '/payments'; | ||
@@ -122,3 +120,3 @@ return api.get({ | ||
return api.post({ | ||
url: BASE_URL + "/" + virtualAccountId + "/receivers", | ||
url: BASE_URL + '/' + virtualAccountId + '/receivers', | ||
data: params | ||
@@ -146,3 +144,3 @@ }, callback); | ||
return api.post({ | ||
url: BASE_URL + "/" + virtualAccountId + "/allowed_payers", | ||
url: BASE_URL + '/' + virtualAccountId + '/allowed_payers', | ||
data: params | ||
@@ -173,3 +171,3 @@ }, callback); | ||
return api.delete({ | ||
url: BASE_URL + "/" + virtualAccountId + "/allowed_payers/" + allowedPayerId | ||
url: BASE_URL + '/' + virtualAccountId + '/allowed_payers/' + allowedPayerId | ||
}, callback); | ||
@@ -176,0 +174,0 @@ } |
import { IMap, INormalizeError, RazorpayPaginationOptions } from "./api"; | ||
import { Invoices } from "./invoices"; | ||
import { Tokens } from "./tokens"; | ||
import { VirtualAccounts } from "./virtualAccounts" | ||
@@ -60,2 +61,83 @@ export declare namespace Customers { | ||
} | ||
interface RazorpayCustomerBankAccountRequestBody { | ||
/** | ||
* The IFSC code of the bank branch associated with the account. | ||
*/ | ||
ifsc_code: string; | ||
/** | ||
* Customer's bank account number. | ||
*/ | ||
account_number: string; | ||
/** | ||
* The name of the beneficiary associated with the bank account. | ||
*/ | ||
beneficiary_name?: string; | ||
/** | ||
* The virtual payment address. | ||
*/ | ||
beneficiary_address1?: string; | ||
beneficiary_address2?: string; | ||
beneficiary_address3?: string; | ||
beneficiary_address4?: string; | ||
/** | ||
* Email address of the beneficiary. For example, `gaurav.kumar@example.com`. | ||
*/ | ||
beneficiary_email?: string; | ||
/** | ||
* Mobile number of the beneficiary. | ||
*/ | ||
beneficiary_mobile?: string; | ||
/** | ||
* The name of the city of the beneficiary. | ||
*/ | ||
beneficiary_city?: string; | ||
/** | ||
* The state of the beneficiary. | ||
*/ | ||
beneficiary_state?: string; | ||
/** | ||
* The country of the beneficiary. | ||
*/ | ||
beneficiary_country?: string; | ||
/** | ||
* The pin code of the beneficiary's address. | ||
*/ | ||
beneficiary_pin?: string; | ||
} | ||
interface RazorpayCustomerBankAccount extends Partial<VirtualAccounts.RazorpayVirtualAccountReceiver>{ | ||
success?: string; | ||
} | ||
interface CustomersEligibility { | ||
id: string; | ||
contact: string; | ||
ip: string; | ||
referrer: string; | ||
user_agent: string; | ||
} | ||
interface RazorpayCustomerEligibilityRequestBody { | ||
inquiry?: string; | ||
amount: number | string; | ||
currency: string; | ||
customer: Partial<CustomersEligibility>; | ||
} | ||
interface Instruments { | ||
method: string; | ||
issuer: string; | ||
type: string; | ||
provider: string; | ||
eligibility_req_id: string; | ||
eligibility: { | ||
status: string; | ||
error: Omit<INormalizeError,'statusCode'> | ||
} | ||
} | ||
interface RazorpayCustomerEligibility extends RazorpayCustomerEligibilityRequestBody { | ||
instruments? : Array<Instruments> | ||
} | ||
} | ||
@@ -139,4 +221,30 @@ | ||
deleteToken(customerId: string, tokenId: string, callback: (err: INormalizeError | null, data: { deleted: boolean }) => void): void; | ||
/** | ||
* Add Bank Account of Customer | ||
* | ||
* @param customerId - The unique identifier of the customer. | ||
* @param param - Check [doc](https://razorpay.com/docs/api/customers/bank-accounts/#1-add-bank-account-of-customer) for required params | ||
*/ | ||
addBankAccount(customerId: string, params: Customers.RazorpayCustomerBankAccountRequestBody): Promise<Customers.RazorpayCustomerBankAccount> | ||
/** | ||
* Delete Bank Account of Customer | ||
* | ||
* @param customerId - The unique identifier of the customer. | ||
* @param bankAccountId - The bank_id that needs to be deleted. | ||
*/ | ||
deleteBankAccount(customerId: string, bankAccountId: string): Promise<Customers.RazorpayCustomerBankAccount> | ||
/** | ||
* Eligibility Check API | ||
* | ||
* @param param - Check [doc](https://razorpay.com/docs/payments/payment-gateway/affordability/eligibility-check/#eligibility-check-api) for required params | ||
*/ | ||
requestEligibilityCheck(param: Customers.RazorpayCustomerEligibilityRequestBody): Promise<Partial<Customers.RazorpayCustomerEligibility>> | ||
/** | ||
* Fetch Eligibility by id | ||
* | ||
* @param eligibilityId - The unique identifier of the eligibility request to be retrieved. | ||
*/ | ||
fetchEligibility(eligibilityId: string): Promise<Partial<Customers.RazorpayCustomerEligibility>> | ||
} | ||
export default customers |
@@ -96,2 +96,9 @@ import { INormalizeError } from "./api"; | ||
| 'unknown' | ||
type ListType = {flow: string;} | {sub_type: string;} | ||
interface RazorpayIinList { | ||
count: number; | ||
iins : string[]; | ||
} | ||
} | ||
@@ -108,4 +115,11 @@ | ||
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<Iins.RazorpayIinList> | ||
all(params: Iins.ListType, callback: (err: INormalizeError | null, data: Iins.RazorpayIinList) => void): void; | ||
} | ||
export default iins |
@@ -0,1 +1,2 @@ | ||
import { Invoices } from './invoices' | ||
import { IMap, RazorpayPaginationOptions, INormalizeError } from './api' | ||
@@ -82,2 +83,29 @@ import { FundAccounts } from './fundAccount' | ||
payment?: RazorpayCapturePayment; | ||
/** | ||
* Identifier to mark the order eligible for RTO risk prediction. | ||
*/ | ||
rto_review?: boolean; | ||
/** | ||
* This will have the details about the specific items added to the cart. | ||
*/ | ||
line_items?: LineItems[]; | ||
/** | ||
* Sum of `offer_price` for all line items added in the cart in paise. | ||
*/ | ||
line_items_total?: number | string; | ||
shipping_fee?: number; | ||
cod_fee?: number; | ||
/** | ||
* Details of the customer. | ||
*/ | ||
customer_details?: CustomerDetails; | ||
/** | ||
* Details of the customer's billing address. | ||
*/ | ||
promotions?: Promotion[]; | ||
/** | ||
* Details of the customer. | ||
*/ | ||
device_details?: DeviceDetails; | ||
phonepe_switch_context? :string; | ||
} | ||
@@ -226,2 +254,170 @@ | ||
} | ||
interface LineItems { | ||
/** | ||
* Defines the category type. Possible values is `mutual_funds` or `e-commerce` | ||
*/ | ||
type: string; | ||
/** | ||
* Unique product id defined by you. | ||
*/ | ||
sku: string; | ||
/** | ||
* Unique variant_id defined by you. | ||
*/ | ||
variant_id: string; | ||
/** | ||
* Price of the product in paise. | ||
*/ | ||
price: string; | ||
/** | ||
* Price charged to the customer in paise. | ||
*/ | ||
offer_price: string; | ||
/** | ||
* The tax levied on the product. | ||
*/ | ||
tax_amount: number; | ||
/** | ||
* Number of units added in the cart. | ||
*/ | ||
quantity: number; | ||
/** | ||
* Name of the product. | ||
*/ | ||
name: string; | ||
/** | ||
* Description of the product. | ||
*/ | ||
description: string; | ||
/** | ||
* Weight of the product in grams. | ||
*/ | ||
weight: string; | ||
/** | ||
* The dimensions of the product. | ||
*/ | ||
dimensions: Dimensions; | ||
/** | ||
* URL of the product image. | ||
*/ | ||
image_url: string; | ||
/** | ||
* URL of the product's listing page. | ||
*/ | ||
product_url: string; | ||
notes?: IMap<string | number>; | ||
} | ||
interface Dimensions { | ||
length: string; | ||
width: string; | ||
height: string; | ||
} | ||
interface Reason { | ||
/** | ||
* Id of the Offer. | ||
*/ | ||
reason: string; | ||
/** | ||
* unique identifier for the RTO reason | ||
*/ | ||
description: string; | ||
/** | ||
* Categorises the reason into a specific group. | ||
*/ | ||
bucket: string; | ||
} | ||
interface CustomerDetails { | ||
/** | ||
* Customer's name. | ||
*/ | ||
name: string; | ||
/** | ||
* The customer's phone number. | ||
*/ | ||
contact: string; | ||
/** | ||
* The customer's email address. | ||
*/ | ||
email: string; | ||
/** | ||
* Details of the customer's shipping address. | ||
*/ | ||
shipping_address: Partial<Invoices.RazorpayInvoiceAddress>; | ||
/** | ||
* Details of the customer's billing address. | ||
*/ | ||
billing_address: Partial<Invoices.RazorpayInvoiceAddress>; | ||
} | ||
interface Promotion { | ||
/** | ||
* Id of the Offer. | ||
*/ | ||
reference_id: string; | ||
/** | ||
* Coupon code used to avail discount. | ||
*/ | ||
code: string; | ||
/** | ||
* Type of Offer. Possible value is `coupon` or `offer` | ||
*/ | ||
type: string; | ||
/** | ||
* The offer value that needs to be applied. | ||
*/ | ||
value: number; | ||
/** | ||
* The type of value. Possible value is `fixed_amount` or `percentage` | ||
*/ | ||
value_type: string; | ||
/** | ||
* Description of the promotion applied. | ||
*/ | ||
description?: string; | ||
} | ||
interface DeviceDetails { | ||
/** | ||
* Public IP Address of the device used to place the order. | ||
*/ | ||
ip: string; | ||
/** | ||
* The user-agent header of the customer's browser. | ||
*/ | ||
user_agent: string; | ||
} | ||
interface RazorpayRtoReview { | ||
/** | ||
* Determines how risky the order is. Possible is `high`, `medium` or `low` | ||
*/ | ||
risk_tier: string; | ||
rto_reasons: Reason[]; | ||
} | ||
interface RazorpayShipping { | ||
waybill: string; | ||
status?: string; | ||
provider?: string; | ||
} | ||
interface RazorpayFulFillmentBaseRequestBody { | ||
/** | ||
* Payment Method opted by the customer to complete the payment. | ||
*/ | ||
payment_method?: string; | ||
/** | ||
* Contains the shipping data. | ||
*/ | ||
shipping?: RazorpayShipping; | ||
} | ||
interface RazorpayFulFillment extends RazorpayFulFillmentBaseRequestBody { | ||
entity: string; | ||
order_id: string; | ||
} | ||
} | ||
@@ -295,4 +491,23 @@ | ||
fetchTransferOrder(orderId: string, callback: (err: INormalizeError | null, data: Orders.RazorpayOrder) => void): void | ||
/** | ||
* View RTO/Risk Reasons | ||
* | ||
* @param orderId - The unique identifier of the order | ||
* | ||
*/ | ||
viewRtoReview(orderId: string): Promise<Orders.RazorpayRtoReview> | ||
viewRtoReview(orderId: string, callback: (err: INormalizeError | null, data: Orders.RazorpayRtoReview) => void): void | ||
/** | ||
* Update the Fulfillment Details | ||
* | ||
* @param orderId - The unique identifier of the order | ||
* @param params - Check [doc](https://razorpay.com/docs/payments/magic-checkout/rto-intelligence/#step-3-update-the-fulfillment-details) for required params | ||
* | ||
*/ | ||
editFulfillment(orderId: string, param: Orders.RazorpayFulFillmentBaseRequestBody): Promise<any> | ||
editFulfillment(orderId: string, param: Orders.RazorpayFulFillmentBaseRequestBody, callback: (err: INormalizeError | null, data: any) => void): void | ||
} | ||
export default orders |
@@ -169,4 +169,39 @@ import { IMap, INormalizeError, INotify, RazorpayPaginationOptions, PartialOptional } from "./api"; | ||
| RazorpayCustomizeCheckout | ||
| RazorpayBankAccount | ||
| RazorpayNetBankingPayment | ||
} | ||
interface RazorpayBankAccount { | ||
method?: string; | ||
bank_account: { | ||
account_number: string; | ||
name: string; | ||
ifsc: string; | ||
} | ||
/** | ||
* Details of the products. | ||
* Check [doc](https://razorpay.com/docs/api/orders/products/create-pl-with-details/) | ||
*/ | ||
products: Products; | ||
} | ||
interface Products { | ||
type: string; | ||
plan: string; | ||
folio: string; | ||
amount: string; | ||
option: string; | ||
scheme: string; | ||
receipt: string; | ||
mf_member_id: string; | ||
mf_user_id: string; | ||
mf_partner: string; | ||
mf_investment_type: string; | ||
mf_amc_code: string; | ||
} | ||
interface RazorpayNetBankingPayment { | ||
order: RazorpayBankAccount | ||
} | ||
interface RazorpayTransferPayment { | ||
@@ -181,3 +216,3 @@ /** | ||
*/ | ||
transfers: PartialOptional<Transfers.RazorpayOrderCreateRequestBody, 'on_hold'>[] | ||
transfers?: PartialOptional<Transfers.RazorpayOrderCreateRequestBody, 'on_hold'>[]; | ||
} | ||
@@ -201,2 +236,3 @@ } | ||
checkout: | ||
| RazorpayCheckoutDisplayPayment | ||
| RazorpayCheckoutRenameLabels | ||
@@ -213,2 +249,24 @@ | RazorpayCheckoutChangeBusinessName | ||
interface RazorpayCheckoutDisplayPayment { | ||
config: { | ||
display: { | ||
blocks: { | ||
banks: { | ||
name: string; | ||
instruments: [ | ||
{ | ||
method: string, | ||
banks: string[] | ||
} | ||
]; | ||
}; | ||
}; | ||
sequence: string[]; | ||
preferences: { | ||
show_default_blocks: boolean; | ||
}; | ||
}; | ||
}; | ||
} | ||
interface RazorpayCheckoutRenameLabels { | ||
@@ -215,0 +273,0 @@ /** |
@@ -45,2 +45,12 @@ import { IMap, INormalizeError, RazorpayPaginationOptions, PartialOptional } from "./api"; | ||
customer_id: string; | ||
/** | ||
* The unique identifier of the subscription. | ||
*/ | ||
subscription_id?: string; | ||
/** | ||
* The authentication channel for the payment. Possible value is `browser` or `app` | ||
*/ | ||
authentication?: { | ||
authentication_channel: string; | ||
}; | ||
} | ||
@@ -234,2 +244,6 @@ | ||
last4?: string; | ||
/** | ||
* The name of the aggregator that provided the token. Possible values are `Visa`, `Mastercard`, `Amex` or `HDFC for Diners` | ||
*/ | ||
provider_type?: string; | ||
} | ||
@@ -427,3 +441,3 @@ | ||
*/ | ||
upi: { | ||
upi?: { | ||
/** | ||
@@ -441,2 +455,6 @@ * Specify the type of the UPI payment flow. | ||
} | ||
/** | ||
* Token of the saved VPA. | ||
*/ | ||
token?: string; | ||
} | ||
@@ -458,50 +476,47 @@ | ||
} | ||
} | ||
interface BrowserInfo { | ||
/** | ||
* Information regarding the customer's browser. | ||
* This parameter need not be passed when `authentication_channel=app`. | ||
* Indicates whether the customer's browser supports Java. | ||
* Obtained from the `navigator` HTML DOM object. | ||
*/ | ||
browser?: { | ||
/** | ||
* Indicates whether the customer's browser supports Java. | ||
* Obtained from the `navigator` HTML DOM object. | ||
*/ | ||
java_enabled: boolean; | ||
/** | ||
* ndicates whether the customer's browser is able to execute JavaScript. | ||
* Obtained from the `navigator` HTML DOM object. | ||
*/ | ||
javascript_enabled: boolean; | ||
/** | ||
* Time difference between UTC time and the cardholder browser local time. | ||
* Obtained from the `getTimezoneOffset()` method applied to Date object. | ||
*/ | ||
timezone_offset: number; | ||
/** | ||
* Total width of the payer's screen in pixels. | ||
* Obtained from the `screen.width` HTML DOM property. | ||
*/ | ||
screen_width: number; | ||
/** | ||
* Obtained from the `navigator` HTML DOM object. | ||
*/ | ||
screen_height: number; | ||
/** | ||
* Obtained from payer's browser using | ||
* the `screen.colorDepth` HTML DOM property. | ||
*/ | ||
color_depth: string; | ||
/** | ||
* Obtained from payer's browser using the navigator. | ||
* language HTML DOM property. Maximum limit of 8 characters. | ||
*/ | ||
language: string; | ||
} | ||
java_enabled: boolean; | ||
/** | ||
* Indicates whether the customer's browser is able to execute JavaScript. | ||
* Obtained from the `navigator` HTML DOM object. | ||
*/ | ||
javascript_enabled: boolean; | ||
/** | ||
* Time difference between UTC time and the cardholder browser local time. | ||
* Obtained from the `getTimezoneOffset()` method applied to Date object. | ||
*/ | ||
timezone_offset: number | string; | ||
/** | ||
* Total width of the payer's screen in pixels. | ||
* Obtained from the `screen.width` HTML DOM property. | ||
*/ | ||
screen_width: number | string; | ||
/** | ||
* Obtained from the `navigator` HTML DOM object. | ||
*/ | ||
screen_height: number | string; | ||
/** | ||
* Obtained from payer's browser using | ||
* the `screen.colorDepth` HTML DOM property. | ||
*/ | ||
color_depth: number | string; | ||
/** | ||
* Obtained from payer's browser using the navigator. | ||
* language HTML DOM property. Maximum limit of 8 characters. | ||
*/ | ||
language: string; | ||
} | ||
interface RazorpayPaymentS2SCreateRequestBody extends RazorpayPaymentBaseRequestBody { | ||
save:boolean | number; | ||
save: boolean | number; | ||
/** | ||
* Pass the unique token id created when the customer made the first payment. | ||
*/ | ||
token?:string; | ||
token?: string; | ||
/** | ||
@@ -525,2 +540,8 @@ * Pass the sub-merchant's unique identifier. | ||
user_agent: string | null; | ||
provider_name?: string; | ||
/** | ||
* Information regarding the customer's browser. | ||
* This parameter need not be passed when `authentication_channel=app`. | ||
*/ | ||
browser?: Partial<BrowserInfo> | ||
} | ||
@@ -564,2 +585,6 @@ | ||
interface ExpandDetails { | ||
'expand[]': 'card' | 'emi' | 'offers' | 'upi' | ||
} | ||
} | ||
@@ -591,4 +616,4 @@ | ||
*/ | ||
fetch(paymentId: string, params?: { 'expand[]': 'card' | 'emi' | 'offers' }): Promise<Payments.RazorpayPayment> | ||
fetch(paymentId: string, params: { 'expand[]': 'card' | 'emi' | 'offers' }, callback: (err: INormalizeError | null, data: Payments.RazorpayPayment) => void): void | ||
fetch(paymentId: string, params?: Payments.ExpandDetails): Promise<Payments.RazorpayPayment> | ||
fetch(paymentId: string, params: Payments.ExpandDetails, callback: (err: INormalizeError | null, data: Payments.RazorpayPayment) => void): void | ||
/** | ||
@@ -831,2 +856,2 @@ * Capture payment | ||
export default payments | ||
export default payments |
'use strict'; | ||
var nodeify = function nodeify(promise, cb) { | ||
if (!cb) { | ||
return promise; | ||
return promise.then(function (response) { | ||
return response.data; | ||
}); | ||
} | ||
return promise.then(function (response) { | ||
cb(null, response); | ||
cb(null, response.data); | ||
}).catch(function (error) { | ||
@@ -11,0 +14,0 @@ cb(error, null); |
{ | ||
"name": "razorpay", | ||
"version": "2.9.3", | ||
"version": "2.9.4", | ||
"description": "Official Node SDK for Razorpay API", | ||
@@ -10,3 +10,3 @@ "main": "dist/razorpay", | ||
"clean": "rm -rf dist && mkdir dist", | ||
"cp-types":"mkdir dist/types && cp lib/types/* dist/types && cp lib/utils/*d.ts dist/utils", | ||
"cp-types": "mkdir dist/types && cp lib/types/* dist/types && cp lib/utils/*d.ts dist/utils", | ||
"cp-ts": "cp lib/razorpay.d.ts dist/ && npm run cp-types", | ||
@@ -39,2 +39,3 @@ "build:commonjs": "babel lib -d dist", | ||
"devDependencies": { | ||
"@types/node": "^20.12.12", | ||
"babel-cli": "^6.26.0", | ||
@@ -48,11 +49,8 @@ "babel-preset-env": "^1.7.0", | ||
"nock": "^13.1.1", | ||
"nyc": "^15.1.0" | ||
"nyc": "^15.1.0", | ||
"typescript": "^4.9.4" | ||
}, | ||
"dependencies": { | ||
"@types/request-promise": "^4.1.48", | ||
"promise": "^8.1.0", | ||
"request": "^2.88.0", | ||
"request-promise": "^4.2.6", | ||
"typescript": "^4.9.4" | ||
"axios": "^1.6.8" | ||
} | ||
} |
@@ -128,2 +128,7 @@ # Razorpay Node SDK | ||
- [Webhook](documents/webhook.md) | ||
- [Dispute](documents/disputes.md) | ||
- [Document](documents/documents.md) | ||
--- | ||
@@ -130,0 +135,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
312064
1
60
8629
159
11
+ Addedaxios@^1.6.8
+ Addedaxios@1.7.7(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removed@types/request-promise@^4.1.48
- Removedpromise@^8.1.0
- Removedrequest@^2.88.0
- Removedrequest-promise@^4.2.6
- Removedtypescript@^4.9.4
- Removed@types/bluebird@3.5.42(transitive)
- Removed@types/caseless@0.12.5(transitive)
- Removed@types/node@22.9.0(transitive)
- Removed@types/request@2.48.12(transitive)
- Removed@types/request-promise@4.1.51(transitive)
- Removed@types/tough-cookie@4.0.5(transitive)
- Removedajv@6.12.6(transitive)
- Removedasap@2.0.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.32.5.2(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedlodash@4.17.21(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpromise@8.3.0(transitive)
- Removedpsl@1.10.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedrequest-promise@4.2.6(transitive)
- Removedrequest-promise-core@1.1.4(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedstealthy-require@1.1.1(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removedtypescript@4.9.5(transitive)
- Removedundici-types@6.19.8(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)