Overview
The Akatus .NET SDK requires four configuration keys to be set in yourWeb.config file. These settings are automatically loaded by the SDK’s Config class and used for all API requests.
Configuration Keys
Add the following keys to your<appSettings> section in Web.config:
AkatusAmbiente
Type:stringRequired: Yes
Values:
"producao" or "testes"
Specifies which Akatus environment to use. The SDK defaults to "testes" if not set or if any value other than "producao" is provided.
AkatusApiKey
Type:stringRequired: Yes Your Akatus API Key used to authenticate API requests. This is the primary authentication credential for the SDK.
AkatusTokenNIP
Type:stringRequired: Yes (if using payment notifications) The NIP (Notificação Instantânea de Pagamento) token used to validate that payment notifications were actually sent by Akatus. This ensures secure webhook authentication.
AkatusEmail
Type:stringRequired: Yes The email address associated with your Akatus merchant account. This is used to identify the payment recipient.
Complete Configuration Example
Web.config
How Settings Are Loaded
The SDK automatically reads these configuration values usingConfigurationManager.AppSettings. Here’s how the Config class loads each setting:
Config.cs
Security Best Practices
Protecting Sensitive Configuration
-
Use Configuration Transforms
Leverage Web.config transformations to manage different credentials per environment:
Web.Release.config
-
Encrypt appSettings Section
Use ASP.NET’s built-in encryption for the appSettings section:
- Use Environment Variables For cloud deployments, consider storing credentials in environment variables or secure vaults like Azure Key Vault or AWS Secrets Manager.
- Restrict File Permissions Ensure your Web.config file has appropriate file system permissions to prevent unauthorized access.
- Separate Test and Production Keys Always use different API keys for testing and production environments. Never use production credentials in development.
The SDK will use test environment credentials by default if
AkatusAmbiente is not set to "producao", providing an extra safety layer.Next Steps
Environment Configuration
Learn about production vs test environments
Process Transactions
Start processing payments with the cart API