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:
Sai Harsha Vardhan
2024-10-10 18:27:14 +05:30
committed by GitHub
parent e911ea4615
commit 5930089682
36 changed files with 830 additions and 1134 deletions

View File

@ -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)]

View File

@ -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)]