Metadata-Version: 2.3
Name: django-mercadopago-integration
Version: 1.0.0
Summary: Reusable Mercado Pago integration for Django projects
License: MIT
Author: Crhistyan Silva
Author-email: crhistyan.silva@falcode.dev
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: django (>=3.2)
Requires-Dist: djangorestframework
Requires-Dist: requests
Description-Content-Type: text/markdown

# django-mercadopago-integration

Plug-and-play Mercado Pago integration for Django. No model changes — declare your entity in config and the package handles linking automatically.

- **Using the package in your project?** → [**Integration guide**](INTEGRATION.md) (install, credentials, URLs, entity & webhook setup).
- **Developing or publishing this package?** → [**Developer guide**](DEVELOPER.md) (local development, testing, publishing to PyPI).

---

## 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](INTEGRATION.md#callbacks-what-they-are-and-which-ones-exist). |
| **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](INTEGRATION.md) for full steps):

```bash
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

