Cielo Payments

Integração com a API de Pagamentos da Cielo

Overview

This node integrates with the Cielo Payments API, a popular payment gateway in Brazil, to manage credit card transactions. It supports creating payments, capturing authorized payments, canceling payments, and consulting payment status.

A common use case is automating payment processing within workflows, such as charging customers' credit cards directly from n8n when an order is placed or managing payment lifecycle events (capture, cancel, consult) programmatically.

For example, you can create a payment by providing card details and amount, then capture the payment once the order is confirmed, or cancel it if needed. You can also query the status of any payment by its ID.

Properties

Name Meaning
Operation The action to perform: Create Payment, Capture Payment, Cancel Payment, or Consult Payment.
Merchant Order ID Unique identifier for the merchant's order (required for creating a payment).
Valor (em centavos) Amount in cents to be charged or managed (required for creating and optionally for capture/cancel).
Número do Cartão Credit card number used for payment (required for creating a payment).
Nome no Cartão Cardholder's name printed on the credit card.
Data de Validade (MM/YYYY) Expiration date of the credit card in MM/YYYY format.
CVV Security code of the credit card.
Bandeira Credit card brand. Options: Visa, Mastercard, Amex, Elo, Diners, Discover, Hipercard.
Payment ID Identifier of the payment transaction (required for capture, cancel, and consult operations).

Output

The node outputs JSON data representing the response from the Cielo Payments API for the requested operation:

  • For Create Payment, the output includes details about the created payment, such as payment ID, status, and transaction information.
  • For Capture Payment and Cancel Payment, the output contains confirmation and updated payment status.
  • For Consult Payment, the output provides the current state and details of the specified payment.

No binary data is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Cielo Payments API.
  • The node uses the Cielo sandbox URL by default but can be configured to use a different API base URL via credentials.
  • Proper configuration of merchant credentials (MerchantId and MerchantKey) is necessary for successful API calls.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect card details or expired cards will result in payment creation errors.
    • Using an invalid or non-existent Payment ID for capture, cancel, or consult operations will cause errors.
    • Amount values must be provided in cents; incorrect formatting may lead to unexpected results.
  • Error messages:

    • Errors are prefixed with "Erro na operação Cielo:" followed by the specific message from the API or internal error.
    • To resolve, verify all required parameters, ensure credentials are correct, and confirm that the payment IDs exist and are valid for the requested operation.

Links and References

Discussion