Comparing version 2.8.1 to 2.8.2
@@ -96,6 +96,13 @@ 'use strict'; | ||
value: function patch(params, cb) { | ||
return nodeify(this.rq.patch({ | ||
var request = { | ||
url: params.url, | ||
form: params.data | ||
}).catch(normalizeError), cb); | ||
}; | ||
if (params.data.hasOwnProperty("isbody")) { | ||
delete request['form']; | ||
delete params.data.isbody; | ||
request.body = params.data; | ||
} | ||
return nodeify(this.rq.patch(request).catch(normalizeError), cb); | ||
} | ||
@@ -102,0 +109,0 @@ }, { |
@@ -36,6 +36,2 @@ 'use strict'; | ||
if (!key_secret) { | ||
throw new Error('`key_secret` is mandatory'); | ||
} | ||
this.key_id = key_id; | ||
@@ -42,0 +38,0 @@ this.key_secret = key_secret; |
@@ -24,2 +24,3 @@ 'use strict'; | ||
var expand = void 0; | ||
@@ -34,2 +35,6 @@ if (from) { | ||
if (params.hasOwnProperty("expand[]")) { | ||
expand = { "expand[]": params["expand[]"] }; | ||
} | ||
count = Number(count) || 10; | ||
@@ -47,3 +52,4 @@ skip = Number(skip) || 0; | ||
authorized: authorized, | ||
receipt: receipt | ||
receipt: receipt, | ||
expand: expand | ||
} | ||
@@ -50,0 +56,0 @@ }, callback); |
@@ -135,6 +135,6 @@ "use strict"; | ||
edit: function edit(paymentLinkId, params, callback) { | ||
var notes = params.notes, | ||
rest = _objectWithoutProperties(params, ["notes"]); | ||
var rest = params; | ||
var isbody = true; | ||
var data = Object.assign(rest, normalizeNotes(notes)); | ||
var data = _extends({ isbody: isbody }, rest); | ||
@@ -141,0 +141,0 @@ return api.patch({ |
@@ -26,2 +26,3 @@ 'use strict'; | ||
var expand = void 0; | ||
@@ -36,2 +37,6 @@ if (from) { | ||
if (params.hasOwnProperty("expand[]")) { | ||
expand = { "expand[]": params["expand[]"] }; | ||
} | ||
count = Number(count) || 10; | ||
@@ -46,7 +51,13 @@ skip = Number(skip) || 0; | ||
count: count, | ||
skip: skip | ||
skip: skip, | ||
expand: expand | ||
} | ||
}, callback); | ||
}, | ||
fetch: function fetch(paymentId, callback) { | ||
fetch: function fetch(paymentId) { | ||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var callback = arguments[2]; | ||
var expand = void 0; | ||
if (!paymentId) { | ||
@@ -56,4 +67,11 @@ throw new Error('`payment_id` is mandatory'); | ||
if (params.hasOwnProperty("expand[]")) { | ||
expand = { "expand[]": params["expand[]"] }; | ||
} | ||
return api.get({ | ||
url: '/payments/' + paymentId | ||
url: '/payments/' + paymentId, | ||
data: { | ||
expand: expand | ||
} | ||
}, callback); | ||
@@ -284,2 +302,22 @@ }, | ||
}, | ||
otpGenerate: function otpGenerate(paymentId, callback) { | ||
/* | ||
* OTP Generate | ||
* | ||
* @param {String} paymentId | ||
* @param {Function} callback | ||
* | ||
* @return {Promise} | ||
*/ | ||
if (!paymentId) { | ||
return Promise.reject("payment Id is mandatory"); | ||
} | ||
return api.post({ | ||
url: '/payments/' + paymentId + '/otp_generate' | ||
}, callback); | ||
}, | ||
otpSubmit: function otpSubmit(paymentId) { | ||
@@ -309,4 +347,85 @@ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
}, callback); | ||
}, | ||
otpResend: function otpResend(paymentId, callback) { | ||
/* | ||
* OTP Resend | ||
* | ||
* @param {String} paymentId | ||
* @param {Function} callback | ||
* | ||
* @return {Promise} | ||
*/ | ||
if (!paymentId) { | ||
return Promise.reject("payment Id is mandatory"); | ||
} | ||
return api.post({ | ||
url: '/payments/' + paymentId + '/otp/resend' | ||
}, callback); | ||
}, | ||
createUpi: function createUpi() { | ||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var callback = arguments[1]; | ||
/* | ||
* Initiate a payment | ||
* | ||
* @param {Object} params | ||
* @param {Function} callback | ||
* | ||
* @return {Promise} | ||
*/ | ||
var url = 'payments/create/upi', | ||
rest = _objectWithoutProperties(params, []), | ||
data = Object.assign(rest); | ||
return api.post({ | ||
url: url, | ||
data: data | ||
}, callback); | ||
}, | ||
validateVpa: function validateVpa() { | ||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var callback = arguments[1]; | ||
/* | ||
* Validate the VPA | ||
* | ||
* @param {Object} params | ||
* @param {Function} callback | ||
* | ||
* @return {Promise} | ||
*/ | ||
var url = 'payments/validate/vpa', | ||
rest = _objectWithoutProperties(params, []), | ||
data = Object.assign(rest); | ||
return api.post({ | ||
url: url, | ||
data: data | ||
}, callback); | ||
}, | ||
fetchPaymentMethods: function fetchPaymentMethods(callback) { | ||
/* | ||
* Validate the VPA | ||
* | ||
* @param {Object} params | ||
* @param {Function} callback | ||
* | ||
* @return {Promise} | ||
*/ | ||
var url = 'methods'; | ||
return api.get({ | ||
url: url | ||
}, callback); | ||
} | ||
}; | ||
}; |
@@ -99,4 +99,7 @@ 'use strict'; | ||
fetchOndemandSettlementById: function fetchOndemandSettlementById(settlementId, callback) { | ||
fetchOndemandSettlementById: function fetchOndemandSettlementById(settlementId) { | ||
var param = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var callback = arguments[2]; | ||
var expand = void 0; | ||
/* | ||
@@ -116,4 +119,11 @@ * Fetch On-demand Settlements by ID | ||
if (param.hasOwnProperty("expand[]")) { | ||
expand = { "expand[]": param["expand[]"] }; | ||
} | ||
return api.get({ | ||
url: BASE_URL + '/ondemand/' + settlementId | ||
url: BASE_URL + '/ondemand/' + settlementId, | ||
data: { | ||
expand: expand | ||
} | ||
}, callback); | ||
@@ -135,2 +145,3 @@ }, | ||
var expand = void 0; | ||
var from = params.from, | ||
@@ -143,2 +154,6 @@ to = params.to, | ||
if (params.hasOwnProperty("expand[]")) { | ||
expand = { "expand[]": params["expand[]"] }; | ||
} | ||
return api.get({ | ||
@@ -150,3 +165,4 @@ url: url, | ||
count: count, | ||
skip: skip | ||
skip: skip, | ||
expand: expand | ||
}) | ||
@@ -172,3 +188,3 @@ }, callback); | ||
skip = params.skip, | ||
url = BASE_URL + '/report/combined'; | ||
url = BASE_URL + '/recon/combined'; | ||
@@ -175,0 +191,0 @@ |
{ | ||
"name": "razorpay", | ||
"version": "2.8.1", | ||
"version": "2.8.2", | ||
"description": "Official Node SDK for Razorpay API", | ||
@@ -5,0 +5,0 @@ "main": "dist/razorpay", |
@@ -91,2 +91,4 @@ # Razorpay Node SDK | ||
- [Fund](documents/fund.md) | ||
- [Refunds](documents/refund.md) | ||
@@ -93,0 +95,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2334
146
0
83393
25