npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nicogorga/medusa-payment-mercadopago

v0.2.6

Published

Mercado Pago payment provider plugin for MedusaJS

Downloads

622

Readme

@nicogorga/medusa-payment-mercadopago

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

Features

  • Mercado Pago integration via Checkout API
  • Payments created asynchronously via webhook event.
  • Payments automatically captured (so far as for Uruguay, Credit / Debit is auto capture)
  • Customers and Cards automatically saved to Mercado Pago, so you can implement saved cards in the frontend

Prerequisites

  • Node.js v20 or greater
  • A Medusa backend
  • For local testing, you need to expose localhost. You can use ngrok
  • Mercado Pago developers setup:
  • Setup Mercado Pago (credentials)[https://www.mercadopago.com.uy/developers/es/docs/your-integrations/credentials]:
    • Generate test credentials and optionally, production credentials.
  • Setup Mercado Pago webhok notifications
    • Under "Eventos", select Pagos
    • (Optional) Generate a webhook secret. Although it is optional, it is recommended for security purposes.
    • Go to your Medusa backend, run yarn dev and in a separate terminal ngrok http 9000. If you are serving the backend in a port other than 9000, change the last argument accordingly.
      • Your localhost will be exposed by a URL like: https://d76b-2800-a4-15d2-2900-1105-b8e5-c64-7697.ngrok-free.app.
      • Grab the generated URL and go to Mercado Pago webhook configuration. Under "URL para prueba", specify [ngrok URL]/hooks/payment/mercadopago_mercadopago, replaceing ngrok URL accordingly
  • A frontend that integrates Payment brick. I suggest you clone this Storefront

How to Install

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 .env:

# Access Token available in your Mercado Pago application Test Credentials section
MERCADOPAGO_ACCESS_TOKEN=
# (Optional) Webhook secret available in your Mercado Pago application Webhooks section
MERCADOPAGO_WEBHOOK_SECRET=

3. In medusa-config.ts add the following at the end of the plugins 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 medusa-config.ts add the following to the modules 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
            ]
          }
        ],
      }
    }
  ],

Test the Plugin

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 localhost:9000/store/mercadopago/payment with a body that adheres to validator


Additional Resources