fix: surcharge related status and rules fix (#2974)

Co-authored-by: Bernard Eugine <114725419+bernard-eugine@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2023-11-24 18:44:28 +05:30
committed by GitHub
parent d56d805570
commit 3db721388a
15 changed files with 46 additions and 65 deletions

View File

@ -113,7 +113,8 @@ where
enums::AttemptStatus::Charged => {
let captured_amount =
types::Capturable::get_capture_amount(&self.request, payment_data);
if Some(payment_data.payment_attempt.get_total_amount()) == captured_amount {
let total_capturable_amount = payment_data.payment_attempt.get_total_amount();
if Some(total_capturable_amount) == captured_amount {
enums::AttemptStatus::Charged
} else if captured_amount.is_some() {
enums::AttemptStatus::PartialCharged