mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(core): enable surcharge support for all connectors (#3109)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -322,9 +322,7 @@ impl PaymentsRequest {
|
||||
pub fn get_total_capturable_amount(&self) -> Option<i64> {
|
||||
let surcharge_amount = self
|
||||
.surcharge_details
|
||||
.map(|surcharge_details| {
|
||||
surcharge_details.surcharge_amount + surcharge_details.tax_amount.unwrap_or(0)
|
||||
})
|
||||
.map(|surcharge_details| surcharge_details.get_total_surcharge_amount())
|
||||
.unwrap_or(0);
|
||||
self.amount
|
||||
.map(|amount| i64::from(amount) + surcharge_amount)
|
||||
|
||||
Reference in New Issue
Block a user