From 0cbb778e2b0ade412a4cdd7ba2e984a4059ec5dd Mon Sep 17 00:00:00 2001 From: Nicholas Pedroso Date: Thu, 3 Dec 2020 11:02:20 -0300 Subject: [PATCH] Add statement_descriptor on Preferences Model; Allow user to dynamically change credentials --- lib/configurations.js | 11 +++++++---- lib/models/preferencesModel.js | 3 +++ package.json | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/configurations.js b/lib/configurations.js index 36595257..0fe512d0 100644 --- a/lib/configurations.js +++ b/lib/configurations.js @@ -41,10 +41,13 @@ configurationsModule.configure = function (configurations) { throw new Error('You must provide client_id and client_secret'); } - if (configurations.client_id !== undefined && configurations.client_secret !== undefined - && (clientId !== undefined || clientSecret !== undefined)) { - throw new Error('Cant change client_id or client_secret because is already set'); - } + // ### We commented this next validation. + // ### It is a customer desire to change clientSecret and clientId dynamically + + // if (configurations.client_id !== undefined && configurations.client_secret !== undefined + // && (clientId !== undefined || clientSecret !== undefined)) { + // throw new Error('Cant change client_id or client_secret because is already set'); + // } clientId = clientId || configurations.client_id; clientSecret = clientSecret || configurations.client_secret; diff --git a/lib/models/preferencesModel.js b/lib/models/preferencesModel.js index 228dd6d1..e152462d 100644 --- a/lib/models/preferencesModel.js +++ b/lib/models/preferencesModel.js @@ -125,6 +125,9 @@ module.exports = { } } }, + statement_descriptor: { + type: 'string' + }, payment_methods: { type: 'object', properties: { diff --git a/package.json b/package.json index 6a6a0f45..7817a208 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mercadopago", - "version": "1.5.1", + "version": "1.5.2", "description": "Mercadopago SDK for Node.js", "main": "index.js", "scripts": {