Skip to content

Commit

Permalink
[IMP] shopinvader_api_payment: add amount_formatted into payable info
Browse files Browse the repository at this point in the history
  • Loading branch information
marielejeune committed Jan 19, 2024
1 parent 5b40c9b commit 0b87fca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions shopinvader_api_payment/routers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions shopinvader_api_payment/schemas/payment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class PaymentInput(BaseModel):
class PaymentData(PaymentInput):
payable_reference: str
amount: float
amount_formatted: str
currency_code: str


Expand Down
2 changes: 2 additions & 0 deletions shopinvader_api_payment_cart/routers/cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0b87fca

Please sign in to comment.