Skip to main content

Reusable Mercado Pago integration for Django projects

Project description

django-mercadopago-integration

Plug-and-play Mercado Pago integration for Django. Direct integration out of the box — fully customizable via config and handlers. No model changes — declare your entity in config and the package handles linking automatically.

Actively developed — more features and customization options are added over time.

  • Using the package in your project?Integration guide (install, credentials, URLs, entity & webhook setup).
  • Developing or publishing this package?Developer guide (local development, testing, publishing to PyPI).

What it offers (high level)

  • Direct payments — Charge customers from your main account.
  • Third-party account linking — Connect sellers/suppliers via OAuth; they authorize once, the package links them to your entities automatically.
  • Split payments — Split each payment between your business and linked third parties; fees and commissions tracked in Payment, Income, and Commission models.
  • Automatic logs — Every webhook and notification is logged in MercadoPagoNotificationLog for audit and debugging.
  • Notification handling — Webhook endpoint included; processes MP notifications, creates records, and calls your custom handler when configured.

What you get

What Description
URLs Include mercado_pago.urls to get callback, payments, webhook, and refresh routes.
Endpoints OAuth callback, direct payment (main account), notifications. Per-entity: register, disconnect, create_payment (split to that entity’s account).
Callbacks OAuth GET /mercado_pago/oauth_callback/ (MP redirect; links account to entity). Webhook POST /mercado_pago/notifications/ (notifications; creates Payment/Income/Commission and optionally calls notification_handler). See INTEGRATION.md → Callbacks.
Models MercadoPagoAccount, MercadoPagoAccountLink, MercadoPagoNotificationLog, MercadoPagoPayment, MercadoPagoIncome, MercadoPagoAppCommission. Payment/Income/Commission are created automatically for approved notifications.
Admin Django admin for accounts, links, and notification logs.

Quick start (see INTEGRATION.md for full steps):

pip install django-mercadopago-integration

Add "mercado_pago" to INSTALLED_APPS, run migrations, set credentials, and include the URLs. For per-entity register, disconnect, and create_payment, add entity_model (and optional fee/notification keys) to MERCADO_PAGO and mount the nested ViewSet — no code in your app, linking and payments are automatic.

License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_mercadopago_integration-1.0.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mercadopago_integration-1.0.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file django_mercadopago_integration-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django_mercadopago_integration-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6312a215bd8b5e1a1cb896ba34e8bcb478e44cb81ddefe8b566ae85acde18e45
MD5 3c6eab8a14bc0cd3b951e8488b2e8194
BLAKE2b-256 3ed57483da3745e461f02747ee6b72429f9a82724be958c26c554ef9071bae1d

See more details on using hashes here.

File details

Details for the file django_mercadopago_integration-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mercadopago_integration-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47d0ddadafcd7358c92587ed1891b179235d804f00575ac6383ef718102bafc1
MD5 29f3293b73274ef8d04ca9c2e4f66fad
BLAKE2b-256 34d4d29ab88efa1e6c27594630eff5b03ef3c311023d40d072a62c0e7a593544

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page