Skip to main content

Mercadopago SDK module for Payments integration

Project description

Mercado Pago SDK for Python

PyPI PyPI Downloads APM

This library provides developers with a simple set of bindings to help you integrate Mercado Pago API to a website and start receiving payments.

💡 Requirements

Python 3.9 or higher.

📲 Installation

Run pip3 install mercadopago

🌟 Getting Started

First time using Mercado Pago? Create your Mercado Pago account.

Copy your Access Token in the credentials panel and replace the text YOUR_ACCESS_TOKEN with it.

Simple usage

import mercadopago

sdk = mercadopago.SDK("YOUR_ACCESS_TOKEN")

request_options = mercadopago.config.RequestOptions()
request_options.custom_headers = {
    'x-idempotency-key': '<SOME_UNIQUE_VALUE>'
}

payment_data = {
    "transaction_amount": 100,
    "token": "CARD_TOKEN",
    "description": "Payment description",
    "payment_method_id": 'visa',
    "installments": 1,
    "payer": {
        "email": 'test_user_123456@testuser.com'
    }
}
result = sdk.payment().create(payment_data, request_options)
payment = result["response"]

print(payment)

Per-request configuration

All methods that make API calls accept an optional RequestOptions object. This can be used to configure some special options of the request, such as changing credentials or custom headers.

import mercadopago
from mercadopago.config import RequestOptions

request_options = RequestOptions(access_token='YOUR_ACCESS_TOKEN')
# ...

result = sdk.payment().create(payment_data, request_options)
payment = result["response"]

📚 Documentation

Visit our Dev Site for further information regarding:

Check our official code reference to explore all available functionalities.

🤝 Contributing

All contributions are welcome, ranging from people wanting to triage issues, others wanting to write documentation, to people wanting to contribute code.

Please read and follow our contribution guidelines. Contributions not following this guidelines will be disregarded. The guidelines are in place to make all of our lives easier and make contribution a consistent process for everyone.

❤️ Support

If you require technical support, please contact our support team at developers.mercadopago.com.

🏻 License

MIT license. Copyright (c) 2021 - Mercado Pago / Mercado Libre
For more information, see the LICENSE file.

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

mercadopago-3.0.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

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

mercadopago-3.0.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file mercadopago-3.0.0.tar.gz.

File metadata

  • Download URL: mercadopago-3.0.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mercadopago-3.0.0.tar.gz
Algorithm Hash digest
SHA256 0b20425dc7f704aa099b91ce69eedd9df6eca0b45a7f7ef20197cfa46ba9279d
MD5 fbb99c3ed394d8b0aad1f17b21c9cb77
BLAKE2b-256 98b91517e82346bdfda978ee94c97bb1c6faf78c7c35c6a29ffd72a933064e4a

See more details on using hashes here.

File details

Details for the file mercadopago-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: mercadopago-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mercadopago-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 231a6ab4896d62a8b96ebec6729ce3b5681c6ba928e32f44a77eb71ad14643c9
MD5 32a15316f553d6c1ff9e2611a643bfbf
BLAKE2b-256 cca3b44eecf0d2d7787e2cc457cc4866b6fd38b468df04366605436be874a475

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