Рефактор
Deploy / deploy (push) Successful in 18m5s

This commit is contained in:
Раис Юсупалиев
2026-06-26 19:29:11 +03:00
parent c6c37640fd
commit 843175f12e
36 changed files with 795 additions and 461 deletions
+13 -13
View File
@@ -35,7 +35,7 @@ from app.adapters.delivery_providers.cse.soap import (
make_field,
parse_response,
)
from app.config import AdapterConfig
from app.config import CSEDeliveryProviderConfig
from app.schemas.payment import InitPaymentRequest
from app.schemas.request import DeliveryCalculationRequest
from app.schemas.response import DeliveryPrice
@@ -212,27 +212,27 @@ class CSEProvider(DeliveryProvider):
self._delivery_types: list[tuple[str, str]] | None = None
@classmethod
def from_adapter_config(
def from_config(
cls,
*,
http_client: httpx.AsyncClient,
adapter_config: AdapterConfig,
config: CSEDeliveryProviderConfig,
) -> "CSEProvider":
client = CSEClient(
http_client=http_client,
base_url=adapter_config.cse_base_url,
login=adapter_config.cse_login,
password=adapter_config.cse_password,
base_url=config.base_url,
login=config.login,
password=config.password,
registration_params=CSEOrderRegistrationParams(
payer=adapter_config.cse_payer,
payment_method=adapter_config.cse_payment_method,
shipping_method=adapter_config.cse_shipping_method,
payer=config.payer,
payment_method=config.payment_method,
shipping_method=config.shipping_method,
),
timeout_seconds=adapter_config.cse_timeout_seconds,
retry_attempts=adapter_config.cse_retry_attempts,
retry_backoff_seconds=adapter_config.cse_retry_backoff_seconds,
timeout_seconds=config.timeout_seconds,
retry_attempts=config.retry_attempts,
retry_backoff_seconds=config.retry_backoff_seconds,
)
return cls(client=client, cache_ttl_seconds=adapter_config.cse_cache_ttl_seconds)
return cls(client=client, cache_ttl_seconds=config.cache_ttl_seconds)
async def get_prices(
self, request: DeliveryCalculationRequest