Добавлен провайдер доставки CSE: SOAP-адаптер (Calc + SaveDocuments), маршрутизация init-payment по провайдеру, обобщение tariff_code до строки, география CSE в cities_map
Deploy / deploy (push) Failing after 52s
Deploy / deploy (push) Failing after 52s
This commit is contained in:
@@ -48,7 +48,7 @@ def map_cdek_order_request(
|
||||
payload: dict[str, Any] = {
|
||||
"number": order_uuid,
|
||||
"type": 2,
|
||||
"tariff_code": request.system_data.tariff.tariff_code,
|
||||
"tariff_code": _to_cdek_tariff_code(request.system_data.tariff.tariff_code),
|
||||
"print": _CDEK_WAYBILL_PRINT_TYPE,
|
||||
"sender": _map_party(request.sender_contact),
|
||||
"recipient": _map_party(request.receiver_contact),
|
||||
@@ -61,6 +61,15 @@ def map_cdek_order_request(
|
||||
return payload
|
||||
|
||||
|
||||
def _to_cdek_tariff_code(tariff_code: str) -> int:
|
||||
try:
|
||||
return int(tariff_code)
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise CDEKOrderMappingError(
|
||||
f"CDEK tariff_code must be numeric: {tariff_code!r}."
|
||||
) from exc
|
||||
|
||||
|
||||
def map_cdek_order_response(payload: dict[str, Any]) -> CDEKOrderRegistrationResult:
|
||||
entity = payload.get("entity")
|
||||
if not isinstance(entity, dict):
|
||||
|
||||
Reference in New Issue
Block a user