Mercado Pago icon

Mercado Pago

Integração com APIs do Mercado Pago para processamento de pagamentos

Actions5

Overview

This node integrates with the Mercado Pago payment platform to update existing payment records. It is designed for scenarios where you need to modify details of a payment after it has been created, such as changing its status, adjusting the transaction amount, setting capture options for two-step payments, or updating the expiration date.

Typical use cases include:

  • Capturing a previously authorized payment.
  • Changing the payment status (e.g., from pending to approved).
  • Adjusting the transaction amount before finalizing the payment.
  • Updating the expiration date of a payment reservation.

For example, if you have a payment that was initially authorized but not captured, you can use this node to capture it by setting the "Capturar" property to true. Or, if you want to cancel a payment, you can update its status accordingly.

Properties

Name Meaning
ID do Pagamento The numeric ID of the payment to update. This is required and must be a string containing only digits.
Capturar Boolean flag indicating whether to capture the payment in a two-step payment process. true means capture, false means reserve only. Default is true.
Data de Expiração The expiration date of the payment in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ssZ). Optional.
Status The new status of the payment. Options are: Pendente (pending), Aprovado (approved), Autorizado (authorized), Cancelado (cancelled). Optional.
Novo Valor da Transação New transaction amount as a number. Optional; used to update the payment amount.

Output

The node outputs an array of JSON objects representing the updated payment data returned from the Mercado Pago API. Each item contains the full response from the API about the payment after the update operation.

If the payment update includes any binary data (not indicated in this code), it would be included accordingly, but this node primarily deals with JSON responses describing payment details.

Dependencies

  • Requires an API key credential for Mercado Pago with appropriate permissions.
  • The node makes authenticated HTTP requests to the Mercado Pago API endpoint at https://api.mercadopago.com/v1/payments/{paymentId}.
  • Proper configuration of the API authentication token (access token) is necessary in n8n credentials.
  • The access token must be valid and correspond to the correct environment (sandbox or production).

Troubleshooting

  • Invalid Payment ID: If the payment ID is missing, empty, or contains non-numeric characters, the node will throw an error. Ensure the payment ID is provided and numeric.
  • Invalid Date Format: The expiration date must follow the ISO 8601 format (yyyy-MM-dd'T'HH:mm:ssZ). Incorrect formats will cause errors.
  • Invalid Transaction Amount: The transaction amount cannot exceed R$ 999,999.99. Values outside this range will trigger validation errors.
  • Authentication Errors: If the access token is invalid, expired, or misconfigured, the node will fail with an authentication error. Verify your API credentials and environment settings.
  • API URL Errors: If the constructed API URL is invalid or contains unexpected parameters, the node will throw an error. Check the payment ID and other parameters.
  • Empty Update Parameters: If no update fields (status, capture flag, expiration date, or transaction amount) are provided, the node will throw an error indicating that at least one parameter must be set.

Links and References


This summary is based on static analysis of the bundled source code and the provided input properties definition.

Discussion