diff --git a/shopinvader_api_payment/routers/utils.py b/shopinvader_api_payment/routers/utils.py index 0b6db4b259..7be64d5b2e 100644 --- a/shopinvader_api_payment/routers/utils.py +++ b/shopinvader_api_payment/routers/utils.py @@ -13,6 +13,7 @@ class Payable(BaseModel): payable_model: str payable_reference: str amount: float + amount_formatted: str currency_id: int partner_id: int company_id: int diff --git a/shopinvader_api_payment/schemas/payment_data.py b/shopinvader_api_payment/schemas/payment_data.py index 1c037b1e04..6af7986709 100644 --- a/shopinvader_api_payment/schemas/payment_data.py +++ b/shopinvader_api_payment/schemas/payment_data.py @@ -15,6 +15,7 @@ class PaymentInput(BaseModel): class PaymentData(PaymentInput): payable_reference: str amount: float + amount_formatted: str currency_code: str diff --git a/shopinvader_api_payment_cart/routers/cart.py b/shopinvader_api_payment_cart/routers/cart.py index f0bf85fff8..507dbfc3ac 100644 --- a/shopinvader_api_payment_cart/routers/cart.py +++ b/shopinvader_api_payment_cart/routers/cart.py @@ -39,12 +39,14 @@ def init( payable_model="sale.order", payable_reference=sale_order.name, amount=sale_order.amount_total, + amount_formatted=sale_order.currency_id.format(sale_order.amount_total), currency_id=sale_order.currency_id.id, partner_id=sale_order.partner_id.id, company_id=sale_order.company_id.id, ).model_dump_json(), "payable_reference": sale_order.name, "amount": sale_order.amount_total, + "amount_formatted": sale_order.currency_id.format(sale_order.amount_total), "currency_code": sale_order.currency_id.name, } payment_data["access_token"] = payment_utils.generate_access_token(