Skip to main content

Overview

The Akatus.Carrinho.Carrinho class is the main entry point for processing payment transactions through the Akatus API. It encapsulates all the necessary information about the payer, products, and transaction details.

Properties

Pagador
Pagador
Data about the customer who will make the payment. See Pagador for details.
Produtos
List<Produto>
List of products in the shopping cart. Minimum 1 product, maximum 100 products. See Produto for details.
Transacao
Transacao
Stores all data related to the transaction, including payment method and payment details. See Transacao for details.

Methods

processaTransacao()

Processes the transaction and submits it to the Akatus API. Returns: Akatus.Carrinho.Retorno The Retorno object contains the following properties:
Carrinho
string
Shopping cart identifier
Transacao
string
Transaction identifier
Status
StatusTransacao
Transaction status. Possible values:
  • aguardandoPagamento - Awaiting Payment
  • emAnalise - Under Analysis
  • aprovado - Approved
  • cancelado - Cancelled
  • processando - Processing
  • completo - Complete
  • devolvido - Refunded
  • estornado - Reversed
  • chargeback - Chargeback
UrlRetorno
string
URL for the boleto or bank page (returned for boleto, tef_itau, tef_bradesco payment methods)
Referencia
string
Transaction reference for internal system control (returned only for credit card payments)

Usage Example

using Akatus.Carrinho;

// Create a new shopping cart
var carrinho = new Carrinho();

// Configure the payer
carrinho.Pagador.Nome = "João Silva";
carrinho.Pagador.Email = "joao@example.com";

// Add an address
var endereco = new PagadorEndereco
{
    Tipo = Akatus.Enums.TipoEndereco.comercial,
    Logradouro = "Rua Example",
    Numero = 123,
    Bairro = "Centro",
    Cidade = "São Paulo",
    Estado = "SP",
    Pais = "BRA",
    CEP = "01234567"
};
carrinho.Pagador.Enderecos.Add(endereco);

// Add a phone
var telefone = new PagadorTelefone
{
    Tipo = Akatus.Enums.TipoTelefone.comercial,
    Numero = "1133334444"
};
carrinho.Pagador.Telefones.Add(telefone);

// Add a product
var produto = new Produto
{
    Codigo = "PROD001",
    Descricao = "Product Description",
    Quantidade = 2,
    Preco = 50.00M,
    Peso = 1.5M,
    Frete = 10.00M,
    Desconto = 5.00M
};
carrinho.Produtos.Add(produto);

// Configure the transaction
carrinho.Transacao.MeioDePagamento = Akatus.Enums.MeioDePagamento.boleto;
carrinho.Transacao.Moeda = "BRL";
carrinho.Transacao.Referencia = "REF123";

// Process the transaction
var retorno = carrinho.processaTransacao();

// Check the result
Console.WriteLine($"Transaction ID: {retorno.Transacao}");
Console.WriteLine($"Status: {retorno.Status}");
if (!string.IsNullOrEmpty(retorno.UrlRetorno))
{
    Console.WriteLine($"Boleto URL: {retorno.UrlRetorno}");
}

Build docs developers (and LLMs) love