Mercado Pago payment provider plugin for MedusaJS
Receive payments on your Medusa commerce application using Mercado Pago.
Medusa Payment Mercadopago Repository | Medusa Website | Medusa Repository
[!WARNING] This plugin is a WIP and has only been tested for Credit / Debit Card methods following Mercado Pago docs for Uruguay. You can sumbit issues through GitHub Issues. Feel free to make contributions by making pull requests and proposing ideas / new flows to implement via Discussions
1. Run the following command in the directory of the Medusa backend using your package manager (for example for npm):
npm install @nicogorga/medusa-payment-mercadopago
2. Set the following environment variables in :
# Access Token available in your Mercado Pago application Test Credentials sectionMERCADOPAGO_ACCESS_TOKEN=# (Optional) Webhook secret available in your Mercado Pago application Webhooks sectionMERCADOPAGO_WEBHOOK_SECRET=
3. In add the following at the end of the array in your project config object:
projectConfig: {plugins = [// ...{resolve: `@nicogorga/medusa-payment-mercadopago`,options: {accessToken: process.env.MERCADOPAGO_ACCESS_TOKEN,webhookSecret: process.env.MERCADOPAGO_WEBHOOK_SECRET,},},]}
4. In add the following to the array in your project config object:
modules: [{resolve: '@medusajs/medusa/payment',options: {providers: [{resolve: '@nicogorga/medusa-payment-mercadopago/providers/mercado-pago',id: 'mercadopago',options: {accessToken: process.env.MERCADOPAGO_ACCESS_TOKEN,webhookSecret: process.env.MERCADOPAGO_WEBHOOK_SECRET,},dependencies: [ContainerRegistrationKeys.LOGGER]}],}}],
1. Run the following command in the directory of the Medusa backend to run the backend:
npm run dev
2. Enable Mercadopago in a region in the admin. Alternatively, you can use the Admin APIs.
3. Place an order using a frontend that collects payment data using Mercadopago Payment brick like this. Send a POST to with a body that adheres to validator