Skip to content

Commit

Permalink
refactor(router): replace or with unwrap_or
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Jan 8, 2025
1 parent 5b1ce51 commit dc4875f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/router/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl Capturable for PaymentsAuthorizeData {
| common_enums::IntentStatus::PartiallyCapturedAndCapturable => None,
}
},
common_enums::CaptureMethod::Manual => maximum_capturable_amount.or( Some(payment_data.payment_attempt.get_total_amount())).map(|amount_capturable|amount_capturable.get_amount_as_i64()),
common_enums::CaptureMethod::Manual => Some(maximum_capturable_amount.unwrap_or(payment_data.payment_attempt.get_total_amount()).get_amount_as_i64()),
// In case of manual multiple, amount capturable must be inferred from all captures.
common_enums::CaptureMethod::ManualMultiple |
// Scheduled capture is not supported as of now
Expand Down Expand Up @@ -390,7 +390,7 @@ impl Capturable for CompleteAuthorizeData {
| common_enums::IntentStatus::PartiallyCapturedAndCapturable => None,
}
},
common_enums::CaptureMethod::Manual => maximum_capturable_amount.or(Some(payment_data.payment_attempt.get_total_amount())).map(|amount_capturable| amount_capturable.get_amount_as_i64()),
common_enums::CaptureMethod::Manual => Some(maximum_capturable_amount.unwrap_or(payment_data.payment_attempt.get_total_amount()).get_amount_as_i64()),
// In case of manual multiple, amount capturable must be inferred from all captures.
common_enums::CaptureMethod::ManualMultiple |
// Scheduled capture is not supported as of now
Expand Down

0 comments on commit dc4875f

Please sign in to comment.