mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
fix(connector): [Zen] Convert the amount to base denomination in order_details (#1477)
This commit is contained in:
@ -395,15 +395,20 @@ fn get_item_object(
|
|||||||
_amount: String,
|
_amount: String,
|
||||||
) -> Result<Vec<ZenItemObject>, error_stack::Report<errors::ConnectorError>> {
|
) -> Result<Vec<ZenItemObject>, error_stack::Report<errors::ConnectorError>> {
|
||||||
let order_details = item.request.get_order_details()?;
|
let order_details = item.request.get_order_details()?;
|
||||||
Ok(order_details
|
|
||||||
|
order_details
|
||||||
.iter()
|
.iter()
|
||||||
.map(|data| ZenItemObject {
|
.map(|data| {
|
||||||
name: data.product_name.clone(),
|
Ok(ZenItemObject {
|
||||||
quantity: data.quantity,
|
name: data.product_name.clone(),
|
||||||
price: data.amount.to_string(),
|
quantity: data.quantity,
|
||||||
line_amount_total: (i64::from(data.quantity) * data.amount).to_string(),
|
price: utils::to_currency_base_unit(data.amount, item.request.currency)?,
|
||||||
|
line_amount_total: (f64::from(data.quantity)
|
||||||
|
* utils::to_currency_base_unit_asf64(data.amount, item.request.currency)?)
|
||||||
|
.to_string(),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.collect())
|
.collect::<Result<_, _>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_browser_details(
|
fn get_browser_details(
|
||||||
|
|||||||
Reference in New Issue
Block a user