forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,9 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the enumeration for API environments, providing distinct base URLs for production and sandbox for both BaaS and SBP.
|
||||
// RESPONSIBILITY: To centralize and provide type-safe access to the base URLs of Alfa Bank's various API environments, ensuring that the SDK connects to the correct endpoint based on the configured environment.
|
||||
// INPUTS: None (static definitions).
|
||||
// OUTPUTS: String values representing API base URLs.
|
||||
// LINKS: Core/AlfaConfig.php, Laravel/Config/alfa-bank.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Enums;
|
||||
|
||||
// <SECTION name="enum_definition" intent="Define the API environment enumeration.">
|
||||
// <BELIEF_STATE "The `Environment` enum centralizes the base URLs for different Alfa Bank API environments (BaaS and SBP, production and sandbox). This approach provides a type-safe and easily manageable way to switch between API targets, preventing hardcoded URLs and improving maintainability. Each case maps directly to its respective API base URL.">
|
||||
enum Environment: string
|
||||
{
|
||||
// <SECTION name="baas_environments" intent="Define base URLs for BaaS API environments.">
|
||||
// <BELIEF_STATE "These cases represent the distinct base URLs for the BaaS (Core Banking API) in both production and sandbox modes. They are crucial for routing API requests to the correct Alfa Bank infrastructure.">
|
||||
case PRODUCTION = 'https://baas.alfabank.ru';
|
||||
case SANDBOX = 'https://sandbox.alfabank.ru';
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="sbp_environments" intent="Define base URLs for SBP API environments.">
|
||||
// <BELIEF_STATE "These cases provide the base URLs for the SBP (Faster Payments System) API, distinguishing between production and sandbox endpoints. The sandbox URL specifically includes a port, which is common for testing environments requiring specific network configurations.">
|
||||
case SBP_PRODUCTION = 'https://pay.alfabank.ru/fsCryptoProxy';
|
||||
case SBP_SANDBOX = 'https://217.12.103.132:2443/fsCryptoProxy';
|
||||
// </SECTION>
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
Reference in New Issue
Block a user