Добавлен адаптер к tbank и формирование ссылки на оплату
This commit is contained in:
@@ -48,6 +48,19 @@ class AdapterConfig(BaseModel):
|
||||
cdek_cache_ttl_seconds: int = Field(default=900, gt=0)
|
||||
|
||||
|
||||
class TBankPaymentAuthConfig(BaseModel):
|
||||
terminal_key: str = Field(..., min_length=1)
|
||||
password: str = Field(..., min_length=1)
|
||||
|
||||
|
||||
class TBankPaymentConfig(BaseModel):
|
||||
init_url: str = Field(..., min_length=1)
|
||||
auth: TBankPaymentAuthConfig
|
||||
timeout_seconds: float = Field(default=10.0, gt=0)
|
||||
retry_attempts: int = Field(default=2, ge=0)
|
||||
retry_backoff_seconds: float = Field(default=0.2, ge=0)
|
||||
|
||||
|
||||
class DadataAddressSuggestionsConfig(BaseModel):
|
||||
url: str = "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address"
|
||||
api_key: str = ""
|
||||
@@ -107,6 +120,7 @@ class Settings(BaseSettings):
|
||||
business_logic: BusinessLogicConfig = Field(default_factory=BusinessLogicConfig)
|
||||
repository: RepositoryConfig = Field(default_factory=RepositoryConfig)
|
||||
adapter: AdapterConfig = Field(default_factory=AdapterConfig)
|
||||
tbank_payment: TBankPaymentConfig
|
||||
address_suggestions: AddressSuggestionsConfig = Field(
|
||||
default_factory=AddressSuggestionsConfig
|
||||
)
|
||||
@@ -138,6 +152,7 @@ class _RequiredYamlSections(BaseModel):
|
||||
business_logic: dict[str, Any]
|
||||
repository: dict[str, Any]
|
||||
adapter: dict[str, Any]
|
||||
tbank_payment: dict[str, Any]
|
||||
address_suggestions: dict[str, Any]
|
||||
observability: dict[str, Any]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user