mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
fix(router): allow zero amount for payment intent in list payment methods (#3090)
This commit is contained in:
@ -2237,7 +2237,7 @@ fn filter_amount_based(payment_method: &RequestPaymentMethodTypes, amount: Optio
|
|||||||
// (Some(amt), Some(max_amt)) => amt <= max_amt,
|
// (Some(amt), Some(max_amt)) => amt <= max_amt,
|
||||||
// (_, _) => true,
|
// (_, _) => true,
|
||||||
// };
|
// };
|
||||||
min_check && max_check
|
(min_check && max_check) || amount == Some(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn filter_pm_based_on_allowed_types(
|
fn filter_pm_based_on_allowed_types(
|
||||||
@ -2296,8 +2296,9 @@ fn filter_payment_amount_based(
|
|||||||
pm: &RequestPaymentMethodTypes,
|
pm: &RequestPaymentMethodTypes,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let amount = payment_intent.amount;
|
let amount = payment_intent.amount;
|
||||||
pm.maximum_amount.map_or(true, |amt| amount < amt.into())
|
(pm.maximum_amount.map_or(true, |amt| amount <= amt.into())
|
||||||
&& pm.minimum_amount.map_or(true, |amt| amount > amt.into())
|
&& pm.minimum_amount.map_or(true, |amt| amount >= amt.into()))
|
||||||
|
|| payment_intent.amount == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn filter_payment_mandate_based(
|
async fn filter_payment_mandate_based(
|
||||||
|
|||||||
Reference in New Issue
Block a user