Files
alfa-bank-sdk/src/Laravel/Config/alfa-bank.php
2026-06-09 16:11:15 +03:00

78 lines
4.0 KiB
PHP

<?php
declare(strict_types=1);
/*
// MODULE_CONTRACT: Defines the configuration settings for integrating with Alfa Bank's BaaS and SBP APIs within a Laravel application.
// RESPONSIBILITY: To provide a centralized and environment-aware configuration for API credentials, mTLS certificate paths, and operational environments (sandbox/production), enabling seamless and secure SDK operation.
// INPUTS: Environment variables (`.env` file).
// OUTPUTS: An associative array containing configuration values for BaaS and SBP connectors.
// LINKS: Laravel/AlfaBankServiceProvider.php, Core/AlfaConfig.php, README.md#configuration
*/
// <SECTION name="config_file_definition" intent="Define the main configuration array for the Alfa Bank SDK.">
// <BELIEF_STATE "This configuration file serves as the central repository for environment-specific settings required by the Alfa Bank SDK. By leveraging Laravel's `env()` helper, it allows deployment-specific values to be managed via environment variables, promoting flexibility and security across different environments (e.g., development, staging, production).">
return [
// <SECTION name="baas_config" intent="Configuration specific to the BaaS (Core Banking API) connector.">
// <BELIEF_STATE "The `baas` section holds settings pertinent to the Base Banking API. It defines the paths to the mTLS certificate and private key files, which are crucial for secure mutual TLS authentication. The `environment` setting controls whether the SDK connects to the sandbox or production BaaS endpoint, ensuring correct API targeting.">
'baas' => [
'certificate_path' => env('ALFA_BAAS_CERT_PATH'),
'private_key_path' => env('ALFA_BAAS_KEY_PATH'),
'signing_certificate_path' => env('ALFA_BAAS_SIGNING_CERT_PATH'),
'signing_private_key_path' => env('ALFA_BAAS_SIGNING_KEY_PATH'),
'client_id' => env('ALFA_BAAS_CLIENT_ID'),
'client_secret' => env('ALFA_BAAS_CLIENT_SECRET'),
'environment' => env('ALFA_BAAS_ENV', 'sandbox'), // sandbox or production
],
// </SECTION>
// <SECTION name="sbp_config" intent="Configuration specific to the SBP (Faster Payments System) connector.">
// <BELIEF_STATE "The `sbp` section contains settings tailored for the Faster Payments System integration. Similar to BaaS, it specifies mTLS certificate and private key paths. Additionally, `key_name_alias` is included for SBP-specific key management, and the `environment` dictates the target SBP endpoint.">
'sbp' => [
'certificate_path' => env('ALFA_SBP_CERT_PATH'),
'private_key_path' => env('ALFA_SBP_KEY_PATH'),
'signing_certificate_path' => env('ALFA_SBP_SIGNING_CERT_PATH'),
'signing_private_key_path' => env('ALFA_SBP_SIGNING_KEY_PATH'),
'key_name_alias' => env('ALFA_SBP_KEY_ALIAS'),
'environment' => env('ALFA_SBP_ENV', 'sandbox'),
],
/*
|--------------------------------------------------------------------------
| Webhook Verification
|--------------------------------------------------------------------------
|
| Configure credentials for incoming webhooks if you use Basic Auth.
|
*/
'webhook' => [
'user' => env('ALFA_WEBHOOK_USER'),
'password' => env('ALFA_WEBHOOK_PASSWORD'),
],
/*
|--------------------------------------------------------------------------
| Encryption Keys
|--------------------------------------------------------------------------
|
| Public key for Card PAN encryption (Nominal Accounts).
|
*/
'encryption' => [
'card_public_key' => env('ALFA_CARD_PUBLIC_KEY'),
],
/*
|--------------------------------------------------------------------------
| Logging
|--------------------------------------------------------------------------
|
| By default, all requests and responses are logged using the Laravel logger.
| Set ALFA_LOGGING_ENABLED=false to disable.
|
*/
'logging' => [
'enabled' => env('ALFA_LOGGING_ENABLED', true),
],
];
// </SECTION>