New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mercadopago

Package Overview
Dependencies
Maintainers
6
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mercadopago - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

31

lib/configurations.js

@@ -6,2 +6,5 @@ var sdkVersion = require('../package').version;

var accessToken;
var platformId;
var corporationId;
var integratorId;
var refreshToken;

@@ -49,2 +52,6 @@ var schema = 'https';

accessToken = configurations.access_token || accessToken;
// Set headers parameters
platformId = configurations.platform_id;
corporationId = configurations.corporation_id;
integratorId = configurations.integrator_id;
// Use if to prevent false value

@@ -77,2 +84,26 @@ this.sandbox = (configurations.sandbox !== undefined) ? configurations.sandbox : this.sandbox;

/**
* Get platformId
* @returns {string}
*/
configurationsModule.getPlatformId = function () {
return platformId;
};
/**
* Get corporationId
* @returns {string}
*/
configurationsModule.getCorporationId = function () {
return corporationId;
};
/**
* Get integratorId
* @returns {string}
*/
configurationsModule.getIntegratorId = function () {
return integratorId;
};
/**
* Set accessToken

@@ -79,0 +110,0 @@ * @param {string} token

@@ -39,2 +39,31 @@ /* istanbul ignore next */

},
tracks: {
type: 'array',
items: {
type: 'object',
properties: {
type: {
type: 'string',
maxLength: 256
},
values: {
type: 'object',
properties: {
conversion_id: {
type: 'string',
},
conversion_label: {
type: 'string',
},
pixel_id: {
type: 'string',
}
}
}
}
}
},
metadata: {
type: 'object',
},
payer: {

@@ -41,0 +70,0 @@ type: 'object',

@@ -36,2 +36,3 @@ var request = require('request');

var needIdempotency = !!this.idempotency; // Idempotency from resource
var needPartnersHeaders = !!this.partnersHeaders;
var config = {};

@@ -118,2 +119,5 @@ var payload = {};

access_token: config.access_token ? config.access_token : accessToken,
platformId: needPartnersHeaders || configurations.getPlatformId(),
corporationId: needPartnersHeaders || configurations.getCorporationId(),
integratorId: needPartnersHeaders || configurations.getIntegratorId(),
});

@@ -265,2 +269,14 @@ }).then(function (response) {

if(options.integratorId) {
req.headers['x-integrator-id'] = options.integratorId;
}
if(options.corporationId) {
req.headers['x-corporation-id'] = options.corporationId;
}
if(options.platformId) {
req.headers['x-platform-id'] = options.platformId;
}
if (options.config && options.config.headers && typeof options.config.headers === 'object') {

@@ -267,0 +283,0 @@ headersNames = Object.keys(options.config.headers);

3

lib/resources/payment.js

@@ -10,3 +10,4 @@ var Promise = require('bluebird');

schema: paymentModel,
idempotency: true
idempotency: true,
partnersHeaders: true
};

@@ -13,0 +14,0 @@

@@ -5,3 +5,4 @@ var requestManager = require('../request-manager');

var preferences = module.exports = {
schema: preferencesModel
schema: preferencesModel,
partnersHeaders: true
};

@@ -8,0 +9,0 @@

{
"name": "mercadopago",
"version": "1.2.1",
"version": "1.3.0",
"description": "Mercadopago SDK for Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc