Overview
TheAkatus.Carrinho.Carrinho class is the core component for processing transactions. It handles both credit card and boleto payments, managing cart setup, customer information, products, and transaction processing.
Setting Up a Transaction
Initialize the Cart
Start by creating a new instance of theCarrinho class:
Customer Information (Pagador)
Add the customer’s basic information:Customer Address (PagadorEndereco)
Add the customer’s address details:TipoEndereco.entrega- Delivery addressTipoEndereco.comercial- Commercial address
Customer Phone (PagadorTelefone)
Add the customer’s phone number:TipoTelefone.celular- Mobile phoneTipoTelefone.comercial- Business phoneTipoTelefone.residencial- Residential phone
Adding Products
Add products to the cart:Payment Methods
- Credit Card
- Boleto
- TEF
Processing Credit Card Payments
Configure the transaction for credit card payment:MeioDePagamento.cartao_visa- VisaMeioDePagamento.cartao_master- MastercardMeioDePagamento.cartao_amex- American ExpressMeioDePagamento.cartao_elo- EloMeioDePagamento.cartao_diners- Diners Club
Processing the Transaction
Once all information is configured, process the transaction:Response Properties
TheAkatus.Carrinho.Retorno object contains:
| Property | Description |
|---|---|
Carrinho | Cart identifier |
Status | Transaction status |
Transacao | Unique transaction ID |
UrlRetorno | URL for payment completion |
Referencia | Your reference code for the transaction |
Complete Example
Next Steps
Payment Methods
Learn how to query available payment methods
Transaction Status
Check the status of your transactions
Payment Notifications
Receive real-time payment notifications
Error Handling
Handle errors and exceptions properly