Добавлен CI, добавлена отправка письма о получении оплаты, добавлен order_id в success_url
Deploy / deploy (push) Failing after 10s
Deploy / deploy (push) Failing after 10s
This commit is contained in:
@@ -42,9 +42,11 @@ class CDEKWaybillInfo:
|
||||
url: str | None
|
||||
|
||||
|
||||
def map_cdek_order_request(request: InitPaymentRequest) -> dict[str, Any]:
|
||||
def map_cdek_order_request(
|
||||
request: InitPaymentRequest, order_uuid: str
|
||||
) -> dict[str, Any]:
|
||||
payload: dict[str, Any] = {
|
||||
"number": request.order_uuid,
|
||||
"number": order_uuid,
|
||||
"type": 2,
|
||||
"tariff_code": request.system_data.tariff.tariff_code,
|
||||
"print": _CDEK_WAYBILL_PRINT_TYPE,
|
||||
@@ -52,7 +54,7 @@ def map_cdek_order_request(request: InitPaymentRequest) -> dict[str, Any]:
|
||||
"recipient": _map_party(request.receiver_contact),
|
||||
"from_location": _map_location(request.sender_address),
|
||||
"to_location": _map_location(request.receiver_address),
|
||||
"packages": [_map_package(request)],
|
||||
"packages": [_map_package(request, order_uuid)],
|
||||
}
|
||||
if request.content.description:
|
||||
payload["comment"] = request.content.description
|
||||
@@ -280,12 +282,12 @@ def _map_location(address: Address) -> dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
def _map_package(request: InitPaymentRequest) -> dict[str, Any]:
|
||||
def _map_package(request: InitPaymentRequest, order_uuid: str) -> dict[str, Any]:
|
||||
system_data: SystemData = request.system_data
|
||||
weight_grams = kilograms_string_to_grams(request.system_data.weight)
|
||||
description = request.content.description or request.order_uuid
|
||||
description = request.content.description or order_uuid
|
||||
package: dict[str, Any] = {
|
||||
"number": request.order_uuid,
|
||||
"number": order_uuid,
|
||||
"weight": weight_grams,
|
||||
"comment": description,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user