mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
refactor(router): modify net_amount to be a struct in the domain model of payment_attempt and handle amount changes across all flows (#6252)
Co-authored-by: swangi-kumari <swangi.12015941@lpu.in> Co-authored-by: Swangi Kumari <85639103+swangi-kumari@users.noreply.github.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e911ea4615
commit
5930089682
@ -1144,8 +1144,6 @@ pub struct SurchargeDetailsResponse {
|
||||
pub display_tax_on_surcharge_amount: f64,
|
||||
/// sum of display_surcharge_amount and display_tax_on_surcharge_amount
|
||||
pub display_total_surcharge_amount: f64,
|
||||
/// sum of original amount,
|
||||
pub display_final_amount: f64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, ToSchema)]
|
||||
|
||||
@ -881,6 +881,14 @@ impl RequestSurchargeDetails {
|
||||
pub fn get_total_surcharge_amount(&self) -> MinorUnit {
|
||||
self.surcharge_amount + self.tax_amount.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn get_surcharge_amount(&self) -> MinorUnit {
|
||||
self.surcharge_amount
|
||||
}
|
||||
|
||||
pub fn get_tax_amount(&self) -> Option<MinorUnit> {
|
||||
self.tax_amount
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
|
||||
Reference in New Issue
Block a user