medusa-payment-mercadopago
This is a Medusa plugin that adds Mercado Pago as a payment provider to Medusa ecommerce stores.
The plugin provides a seamless integration between Mercado Pago and MedusaJS, enabling online merchants to easily accept payments from customers in their local currency. The repository includes documentation on how to install and configure the plugin, as well as examples of its usage.
Installation
In the root of your Medusa server, run the following command to install the plugin:
or
Configuration
Register for a MercadoPago account and get your credentials. To configure the plugin, you'll need to set the following environment variables in your environment file (.env)
Next, in
add the following at the end of theCopy to clipboardmedusa-config.js
array:Copy to clipboardplugins
Client side configuration
returns a preference id you should send to Mercadopago Checkout as the preference id.Copy to clipboardmedusa-payment-mercadopago
By using the returned ID, the plugin can obtain the necessary URL to initiate the payment flow with the product information.
Using Preference ID
inserts aCopy to clipboardmedusa-payment-mercadopago
into the PaymentSession's data.Copy to clipboardpreferenceId
Provide this id to initialize your checkout.
Add Mercadopago Checkout Pro
To add Checkout Pro to your client-side, you'll need to install the Mercado Pago frontend SDK. In this example, we'll be using the react-sdk-mercadopago package to integrate the SDK with React.
Once you've installed the SDK, you can initialize the checkout by providing your
and theCopy to clipboardPUBLIC KEY
. Take a look at the example below for guidance.Copy to clipboardpreferenceId
In this example, we've used a button to open Checkout Pro in a modal format, allowing the user to complete their purchase.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue if you encounter any problems.
License
This project is licensed under the MIT License

Build your own plugins
Develop your own plugins with our API to speed up your processes.
Make your plugin available via npm for it to be shared in our Plugin Library with the broader Medusa community.
.png)