Mercado Pago Magento 2 Plugin

Installs: 117 913

Dependents: 2

Suggesters: 0

Security: 0

Stars: 51

Watchers: 19

Forks: 69


3.19.0 2023-01-05 17:03 UTC



Magento 2 - Mercado Pago Module (v3.19.0)

The Mercado Pago plugin for Magento 2 allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.

Documentation in English

For a better experience, you will be redirected to our site by clicking on the links below:

Documentación en Español

Para una mejor experiencia, será redirigido a nuestro sitio haciendo clic en los links a abajo:

Documentação em Português

Para uma melhor experiência, você será redirecionado para o nosso site, clicando nos links abaixo:


Something's wrong? Get in touch with our support

How to code unit tests

This description is intended to help the developer to run the plugin unit tests

Where to write tests - Test project structure

The plugin is divided into two directories in src:

  • Core : where are the codes for all the functionalities
  • Test/Unit: where are the unit tests

"Test/Unit" mirrors the Core folder, so, if in the Core folder I have a "foo" directory with the file "bar":


means that the test folder should look like this (same folder, suffixing the file with "Test"):


Running tests in development environment

Once this plugin is installed in your development environment with Magento, use the phpUnit that is already installed in magento to run the tests. You can do this by calling phpUnit inside Magento's "vendor" directory and pointing to the plugin's installation location (which will probably be app/code/MercadoPago), for example:

magento/vendor/phpunit/phpunit/phpunit --whitelist magento2/app/code/MercadoPago/Core magento/app/code/MercadoPago/Test
  • magento/vendor/phpunit/phpunit/phpunit: calls phpUnit
  • --whitelist magento2/app/code/MercadoPago/Core : Whitelist for code coverage analysis.
  • --whitelist magento2/app/code/MercadoPago/Test : Directory where phpUnit will find the tests.

Tests on GitHub Actions Workflow

Every time you submit a pull request to this repository, a workflow will be triggered that will run the unit tests. If your unit test fails, you won't be able to merge the pull request.