NodeJS

plus-sign-simple

Integrate NodeJS and Mercado Pago

Trexle connects NodeJS to Mercado Pago and 100+ other payment gateways using a single plugin for one time annual fee

Mercado Pago and NodeJS Integration Guide

Login to your MercadoPago dashboard.

  1. Click Create An Account.
  2. Click Create An Account again.
  3. Fill in the registration form and click Register.
    Note: Under Account Type, select business account.
  4. Click the confirmation link you received in the email from MercadoPago to activate your account.
  5. Find your Client ID and Client Secret in your MercagoPago account.

Use the Client ID and Client Secret to integrate Mercado Pago with your website.

Take the credentials you just obtained from Mercado Pago and navigate to Trexle dashboard, click Payments Gateways and select Mercado Pago from the drop down menu as shown below.

Fill into your Mercado Pago credential and click Add Gateway. Click the Activate button next to Mercado Pago, and it will give you a success message and the button will turn into green. You should see something like below.

To integrate Mercado Pago and NodeJS you need Trexle API keys

In your NodeJS project, open a terminal and issue the following command:

npm install trexlejs

If you want to test, consider writing the following example in a test.js file:

var Trexle = require('trexlejs');

var trexle = Trexle.setup({
key: ‘your-api-key’,
production: false
});

trexle.createCharge({
amount: 400,
currency: ‘usd’,
description: ‘test charge’,
email: ‘[email protected]’,
ip_address: ‘66.249.79.118’,
card: {
number: ‘4242424242424242’,
expiry_month: 8,
expiry_year: 2018,
cvc: 123,
name: ‘John Milwood’,
address_line1: ‘423 Shoreline Park’,
address_city: ‘Mountain View’,
address_postcode: 94043,
address_state: ‘CA’,
address_country: ‘US’
}
}, function (response) {
console.log(response.body);
});

Then run the code:

node test.js

How does testing work?

  • Create 2 test users, a seller and a buyer.
  • Use any of the card numbers listed below.
  • Enter the prefix that you need in the field Name and lastname, according to the result you want to test.
  • At last, complete the remaining data with valid information.

Card numbers

Once you are in the credit card form, you can use any of the following cards, according to your country:

Visa Mastercard American Express
Argentina 4509 9535 6623 3704 5031 7557 3453 0604 3711 803032 57522
Brazil 4235 6477 2802 5682 5031 4332 1540 6351 3753 651535 56885
Chile 4168 8188 4444 7115 5416 7526 0258 2580 3757 781744 61804
Colombia 4013 5406 8274 6260 5254 1336 7440 3564 3743 781877 55283
Mexico 4075 5957 1648 3764 5474 9254 3267 0366 no disponible
Peru 4009 1753 3280 6176 no disponible no disponible
Uruguay 4014 6823 8753 2428 5808 8877 7464 1586 no disponible
Venezuela 4966 3823 3110 9310 5177 0761 6430 0010 no disponible

Prefixes

APRO
Approved payment
CONT
Pending payment
CALL
Rejected. Call for authorize
FUND
Rejected by insufficient amount
SECU
Rejected by security code
EXPI
Rejected by expiration date
FORM
Rejected by an error in the form
OTHE
General rejection

Mercado Pago Supported Countries

Mercado Pago Supported Payment Processing Actions

✔ Purchase
✔ Authorize
✔ Capture
✔ Void
✔ Credit
✔ Recurring
✖ Card Store

Key Features

Credit Card Vault: securely store your customers sensitive credit card data using tokens.
Instant PCI-DSS Compliance: your customers credit card data never touches your site or server.
Multiple Gateway Support: Connect your NodeJS site to 100+ payment gateway

About Trexle

Trexle is a powerful online recurring subscription billing platform that integrate Mercado Pago and other +100 payment gateways with NodeJS and other dozen of e-commerce platforms.

About Mercado Pago

Mercado Pago is a respected payment gateway in Argentina, Brazil, Chile, Colombia, Mexico, Peru, Uruguay, Venezuela. Its a trusted name which has established itself over the years as a preferred payment gateway in Latin America. It supports all the Currencies of the respective countries where it is available.

About NodeJS

Node.js is an open-source, cross-platform JavaScript runtime environment for executing JavaScript code server-side, and uses the Chrome V8 JavaScript engine. Historically, JavaScript was used primarily for client-side scripting, in which scripts written in JavaScript are embedded in a webpage's HTML, to be run client-side by a JavaScript engine in the user's web browser. Node.js enables JavaScript to be used for server-side scripting, and runs scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.

Cart