
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
mercadopago
Advanced tools
$ npm install mercadopago
Every method supports either promises and callbacks. For example:
var at = mp.getAccessToken ();
at.then (
function (accessToken) {
console.log (accessToken);
},
function (error) {
console.log (error);
});
is the same as:
mp.getAccessToken(function (err, accessToken){
if (err) {
console.log (err);
} else {
console.log (accessToken);
}
});
In order to use callbacks, simply pass a function as the last parameter.
var MP = require ("mercadopago");
var mp = new MP ("CLIENT_ID", "CLIENT_SECRET");
mp.getPreference ("PREFERENCE_ID");
var preference = {
"items": [
{
"title": "Test",
"quantity": 1,
"currency_id": "USD",
"unit_price": 10.5
}
]
};
mp.createPreference (preference);
var preference = {
"items": [
{
"title": "Test Modified",
"quantity": 1,
"currency_id": "USD",
"unit_price": 20.4
}
]
};
mp.updatePreference ("PREFERENCE_ID", preference);
var filters = {
"id": null,
"site_id": null,
"external_reference": null
};
mp.searchPayment (filters)
.then (
function success (data) {
console.log (JSON.stringify (data, null, 4));
},
function error (err) {
console.log (err);
}
});
mp.getPayment (qs["id"])
.then (
function success (data) {
console.log (JSON.stringify (data, null, 4));
},
function error (err) {
console.log (err);
}
});
mp.cancelPayment ("ID");
mp.refundPayment ("ID");
var MP = require ("mercadopago");
var mp = new MP ("ACCESS_TOKEN");
mp.post ("/v1/payments", payment_data)
.then (...);
mp.post ("/v1/customers", {"email": "email@test.com"})
.then (...);
mp.get ("/v1/customers/CUSTOMER_ID")
.then (...);
You can access any other resource from the MercadoPago API using the generic methods:
// Get a resource, with optional URL params. Also you can disable authentication for public APIs
mp.get ("/resource/uri", [params], [authenticate=true]);
// Create a resource with "data" and optional URL params.
mp.post ("/resource/uri", data, [params]);
// Update a resource with "data" and optional URL params.
mp.put ("/resource/uri", data, [params]);
// Delete a resource with optional URL params.
mp.delete ("/resource/uri", [params]);
For example, if you want to get the Sites list (no params and no authentication):
mp.get ("/sites", null, false)
.then (function (sites) {
console.log (sites);
});
FAQs
Mercadopago SDK for Node.js
The npm package mercadopago receives a total of 23,049 weekly downloads. As such, mercadopago popularity was classified as popular.
We found that mercadopago demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.