|
| 1 | +# Mercado Pago SDK for Python |
| 2 | + |
| 3 | +[](https://pypi.python.org/pypi/mercadopago) |
| 4 | +[](https://pypi.python.org/pypi/mercadopago) |
| 5 | +[](https://github.com/mercadopago/sdk-python) |
| 6 | + |
| 7 | +This library provides developers with a simple set of bindings to help you integrate Mercado Pago API to a website and start receiving payments. |
| 8 | + |
| 9 | +## 💡 Requirements |
| 10 | + |
| 11 | +Python 2 or higher |
| 12 | + |
| 13 | +## 📲 Installation |
| 14 | + |
| 15 | +First time using Mercado Pago? Create your [Mercado Pago account](https://www.mercadopago.com), if you don’t have one already. |
| 16 | + |
| 17 | +**On Python 2.x** |
| 18 | + |
| 19 | +`pip install mercadopago` |
| 20 | + |
| 21 | +**On Python 3.x** |
| 22 | + |
| 23 | +`pip3 install mercadopago` |
| 24 | + |
| 25 | +Copy the access_token in the [credentials](https://www.mercadopago.com/mlb/account/credentials) section of the page and replace YOUR_ACCESS_TOKEN with it. |
| 26 | + |
| 27 | +That's it! Mercado Pago SDK has been successfully installed. |
| 28 | + |
| 29 | +## 🌟 Getting Started |
| 30 | + |
| 31 | + Simple usage looks like: |
| 32 | + |
| 33 | +```python |
| 34 | +import mercadopago |
| 35 | +import json |
| 36 | + |
| 37 | +mp = mercadopago.MP("YOUR_ACCESS_TOKEN") |
| 38 | + |
| 39 | +def index(req, **kwargs): |
| 40 | + preference = { |
| 41 | + "items": [ |
| 42 | + { |
| 43 | + "title": "Test", |
| 44 | + "quantity": 1, |
| 45 | + "currency_id": "USD", |
| 46 | + "unit_price": 10.4 |
| 47 | + } |
| 48 | + ] |
| 49 | + } |
| 50 | + |
| 51 | + mp.create_preference(preference) |
| 52 | +``` |
| 53 | + |
| 54 | +## 📚 Documentation |
| 55 | + |
| 56 | +Visit our Dev Site for further information regarding: |
| 57 | + - Payments APIs: [Spanish](https://www.mercadopago.com.ar/developers/es/guides/payments/api/introduction/) / [Portuguese](https://www.mercadopago.com.br/developers/pt/guides/payments/api/introduction/) |
| 58 | + - Mercado Pago checkout: [Spanish](https://www.mercadopago.com.ar/developers/es/guides/payments/web-payment-checkout/introduction/) / [Portuguese](https://www.mercadopago.com.br/developers/pt/guides/payments/web-payment-checkout/introduction/) |
| 59 | + - Web Tokenize checkout: [Spanish](https://www.mercadopago.com.ar/developers/es/guides/payments/web-tokenize-checkout/introduction/) / [Portuguese](https://www.mercadopago.com.br/developers/pt/guides/payments/web-tokenize-checkout/introduction/) |
| 60 | + |
| 61 | +Check our official code reference to explore all available functionalities. |
| 62 | + |
| 63 | +## ❤️ Support |
| 64 | + |
| 65 | +If you require technical support, please contact our support team at [developers.mercadopago.com](https://developers.mercadopago.com) |
| 66 | + |
| 67 | +## 🏻 License |
| 68 | + |
| 69 | +``` |
| 70 | +MIT license. Copyright (c) 2018 - Mercado Pago / Mercado Libre |
| 71 | +For more information, see the LICENSE file. |
| 72 | +``` |
0 commit comments