mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
fix(router): correct limit for payments list by filters (#2060)
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
use common_enums as storage_enums;
|
||||
use common_utils::pii;
|
||||
use common_utils::{
|
||||
consts::{PAYMENTS_LIST_MAX_LIMIT_V1, PAYMENTS_LIST_MAX_LIMIT_V2},
|
||||
pii,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use time::PrimitiveDateTime;
|
||||
|
||||
use crate::{errors, MerchantStorageScheme};
|
||||
const MAX_LIMIT: u32 = 100;
|
||||
#[async_trait::async_trait]
|
||||
pub trait PaymentIntentInterface {
|
||||
async fn update_payment_intent(
|
||||
@ -388,7 +390,7 @@ impl From<api_models::payments::PaymentListConstraints> for PaymentIntentFetchCo
|
||||
customer_id: value.customer_id,
|
||||
starting_after_id: value.starting_after,
|
||||
ending_before_id: value.ending_before,
|
||||
limit: Some(std::cmp::min(value.limit, MAX_LIMIT)),
|
||||
limit: Some(std::cmp::min(value.limit, PAYMENTS_LIST_MAX_LIMIT_V1)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -427,7 +429,7 @@ impl From<api_models::payments::PaymentListFilterConstraints> for PaymentIntentF
|
||||
customer_id: None,
|
||||
starting_after_id: None,
|
||||
ending_before_id: None,
|
||||
limit: value.limit,
|
||||
limit: Some(std::cmp::min(value.limit, PAYMENTS_LIST_MAX_LIMIT_V2)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user