• Интеграции и плагины
  • Сообщество
  • Связаться с нами
Документация

Нужна помощь в разработке плагина интеграции для Medusa?

Написать намНайти плагины

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы
  • Интеграции и плагины
  • Сообщество
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация
  • Контакты
  • head@gorgojs.com
  • TelegramGitHub
MedusaПлагиныMercadopago
M

Mercadopago

Mercado Pago payment provider plugin for MedusaJS

Нужна доработка этого плагина?

Связаться с нами
npm install @nicogorga/medusa-payment-mercadopago
Категория
Платежи
Создано
Sergei Kudinov
Версия
0.2.6
Последнее обновление
4 месяца назад
Ежемесячные загрузки
307
Звезды на Github
0
npmNPM
MedusaПлагиныMercadopago

@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:
    • Mercadopago developer account
    • Mercado Pago Checkout API application
      • Name your app
      • Choose Pagos Online under "Solution Type"
      • Select Yes to ecommerce platform question and select Otrasplataformas from the dropdown
      • Select CheckoutAPI from the "Product to integrate" dropdown
      • Create application. For more information visit Your Integrations
  • 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 and in a separate terminal . 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: .
      • Grab the generated URL and go to Mercado Pago webhook configuration. Under "URL para prueba", specify , replaceing 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 :

# 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 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
]
}
],
}
}
],

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 with a body that adheres to validator


Additional Resources

  • Mercado Pago Online Payments Docs

Еще в этой категории

Посмотреть все
Платежи
B

Braintree

От Lambda Curry

Braintree plugin for Medusa

GitHubnpm
Платежи
P

Pay payments medusa

От Webbers

The Pay.nl payment provider plugin for Medusa v2

GitHubnpm
Платежи
P

Payu payment plugin

От Samael-bio

PayU India payment gateway plugin for MedusaJS 2.x with redirect-based checkout, webhook support, hash verification, and refunds.

GitHubnpm