Skip to main content

Mercadopagovp

Overview

Mercadopagovp is a Python library designed to facilitate the creation and verification of PIX payments using the MercadoPago API.

Installation

pip install mercadopagovp

Requirements

  • Python 3.9+
  • MercadoPago account
  • MercadoPago API key

Configuration

To use the library, you need a valid MercadoPago API key.

Usage

Creating a PIX Payment

from mercadopagovp import CreatePixPayment

# Define the API key
KEY_SDK = "your_mercadopago_api_key"

# Initialize the payment instance
pix = CreatePixPayment(KEY_SDK)

# Set notification URL
pix.set_url_notification('https://your-domain.com/notification')

#set time to expiration (in minutes)
pix.set_time_limit(10)

# Set payment value
pix.set_value(2.00)

# Create a client
pix.create_client('First Name', 'Last Name', email="email@example.com")

# Create the payment
payment = pix.create_payment('Test Payment')

print("Payment Details:")
print(payment)

Expected Response (PixPayment Dataclass)

status 
Payment Details:
ID: 108412339053
Amount: 2
QR Code: 00020126400014br.gov.bcb.pix0118devpy912@gmail.com52040000530398654042.005802BR5918BERE202405190802466009Sao Paulo62250521mpqrinter108412339053630466AA
Description: Pagamento de teste
Currency ID: BRL
Last Updated: 2025-04-18T20:05:23.000-04:00
Ticket URL: None
Start Date: 2025-04-18T20:05:20.000-04:00
Expiration Date: 2025-04-18T20:15:19.000-04:00
Status Code: pending
Payment Status: pending_waiting_transfer
Time to Expiration: 304 seconds

Verifying a PIX Payment

from mercadopagovp import VerifyPixPayment

# Initialize the verification instance
verify = VerifyPixPayment(KEY_SDK)

# Verify the payment status
status = verify.verify_payment(payment_id=payment.id)

print("Payment Status:")
print(status)

Expected Response (PixPayment Dataclass)

status 
Payment Details:
ID: 108412339053
Amount: 2
QR Code: 00020126400014br.gov.bcb.pix0118devpy912@gmail.com52040000530398654042.005802BR5918BERE202405190802466009Sao Paulo62250521mpqrinter108412339053630466AA
Description: Pagamento de teste
Currency ID: BRL
Last Updated: 2025-04-18T20:05:23.000-04:00
Ticket URL: None
Start Date: 2025-04-18T20:05:20.000-04:00
Expiration Date: 2025-04-18T20:15:19.000-04:00
Status Code: pending
Payment Status: pending_waiting_transfer
Time to Expiration: 304 seconds

License

This project is licensed under the MIT License.

Metadata

Release files for mercadopagovp 0.4.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mercadopagovp 0.4.5.1
File Interpreter ABI Platform
mercadopagovp-0.4.5.1-py3-none-any.whl Python 3 none any Details

Release files / mercadopagovp-0.4.5.1-py3-none-any.whl

Download URL mercadopagovp-0.4.5.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4228baad9b5dacfff70168b6a28207930a9c59dbc53eb47b1c95005c055fdc9d
BLAKE2b-256 checksum
How to use checksums
afed0a0c7d18e2ca28746c913d1eb141827af40a84be51d9c8371db460afa25a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Security for mercadopagovp 0.4.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page