Overview
The Akatus .NET SDK supports two environments: production (producao) and test (testes). Each environment uses different API endpoints and credentials, allowing you to safely develop and test your integration before going live.
Environment Types
Test Environment (testes)
The test environment is designed for development and integration testing. It uses a separate API endpoint and sandbox credentials.
Characteristics:
- Uses sandbox API endpoint:
https://dev.akatus.com/api/v1/ - Requires test API credentials
- No real money transactions
- Safe for development and testing
- Default environment if not explicitly set to production
- Initial integration development
- Testing payment flows
- QA and staging deployments
- Debugging payment issues
Production Environment (producao)
The production environment processes real transactions with actual money transfers.
Characteristics:
- Uses live API endpoint:
https://www.akatus.com/api/v1/ - Requires production API credentials
- Processes real payment transactions
- Subject to Akatus fees and terms
- Must be explicitly enabled
- Live customer transactions
- Production deployments
API Endpoint Differences
The SDK automatically selects the correct API endpoint based on yourAkatusAmbiente configuration:
Carrinho.cs (lines 22-23)
Carrinho.cs (line 109)
Switching Environments
Setting Test Environment
To use the test environment, setAkatusAmbiente to "testes" in your Web.config:
Web.config
The SDK defaults to the test environment if
AkatusAmbiente is omitted, set to "testes", or contains any value other than "producao".Setting Production Environment
To switch to production, change the value to"producao" and update all credentials:
Web.config
Test Credentials
Obtaining Test Credentials
- Sign up for an Akatus developer account at https://dev.akatus.com
- Navigate to your account settings
- Generate your test API key and NIP token
- Use these credentials in your development environment
Test Credit Cards
Akatus provides test credit card numbers for the sandbox environment. These cards simulate different transaction outcomes:| Card Number | Brand | Expected Result |
|---|---|---|
| 5453010000066167 | Mastercard | Approved |
| 4111111111111111 | Visa | Approved |
Test transactions will never charge real money and do not require valid cardholder names or addresses. However, you should still use realistic data formats for proper integration testing.
Test Card Format
When testing, use this format for credit card transactions:Environment-Specific Best Practices
For Test Environment
Use Realistic Test Data
Use Realistic Test Data
While test transactions don’t process real money, use realistic data formats (valid CPF patterns, address formats, etc.) to catch validation issues early.
Test All Payment Methods
Test All Payment Methods
Akatus supports multiple payment methods (credit cards, boleto, bank transfer). Test each method you plan to accept in production.
Test Error Scenarios
Test Error Scenarios
Use invalid data intentionally to test how your application handles API errors and validation failures.
Verify NIP Webhooks
Verify NIP Webhooks
Test your payment notification endpoint with the test NIP token to ensure proper webhook handling.
For Production Environment
Never Log Sensitive Data
Never Log Sensitive Data
In production, never log credit card numbers, CVV codes, or full API keys. Log only transaction IDs and status codes for debugging.
Implement Idempotency
Implement Idempotency
Use unique reference IDs for each transaction to prevent duplicate charges if a request is retried.
Handle Webhooks Properly
Handle Webhooks Properly
Always verify the NIP token matches your configuration before processing payment notifications to prevent spoofing.
Monitor Transaction Status
Monitor Transaction Status
Implement regular status checks for pending transactions to catch any missed webhook notifications.
Verifying Your Environment
You can verify which environment the SDK is using by checking theConfig.Ambiente property:
Common Pitfalls
Next Steps
Process Your First Transaction
Learn how to process payments using the cart API
Payment Notifications
Set up webhooks to receive payment status updates