mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat: enable payment and refund filter at DB query level (#5827)
This commit is contained in:
@ -45,6 +45,7 @@ impl PaymentAttemptInterface for MockDb {
|
||||
_payment_method_type: Option<Vec<PaymentMethodType>>,
|
||||
_authentication_type: Option<Vec<AuthenticationType>>,
|
||||
_merchanat_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
_profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
_storage_scheme: storage_enums::MerchantStorageScheme,
|
||||
) -> CustomResult<i64, StorageError> {
|
||||
Err(StorageError::MockDbError)?
|
||||
|
||||
@ -296,6 +296,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
|
||||
payment_method_type: Option<Vec<PaymentMethodType>>,
|
||||
authentication_type: Option<Vec<AuthenticationType>>,
|
||||
merchant_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
_storage_scheme: MerchantStorageScheme,
|
||||
) -> CustomResult<i64, errors::StorageError> {
|
||||
let conn = self
|
||||
@ -318,6 +319,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
|
||||
payment_method,
|
||||
payment_method_type,
|
||||
authentication_type,
|
||||
profile_id_list,
|
||||
merchant_connector_id,
|
||||
)
|
||||
.await
|
||||
@ -1067,6 +1069,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
|
||||
payment_method_type: Option<Vec<PaymentMethodType>>,
|
||||
authentication_type: Option<Vec<AuthenticationType>>,
|
||||
merchant_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
profile_id_list: Option<Vec<common_utils::id_type::ProfileId>>,
|
||||
storage_scheme: MerchantStorageScheme,
|
||||
) -> CustomResult<i64, errors::StorageError> {
|
||||
self.router_store
|
||||
@ -1078,6 +1081,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
|
||||
payment_method_type,
|
||||
authentication_type,
|
||||
merchant_connector_id,
|
||||
profile_id_list,
|
||||
storage_scheme,
|
||||
)
|
||||
.await
|
||||
|
||||
@ -553,7 +553,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
|
||||
query = query.filter(pi_dsl::customer_id.eq(customer_id.clone()));
|
||||
}
|
||||
if let Some(profile_id) = ¶ms.profile_id {
|
||||
query = query.filter(pi_dsl::profile_id.eq(profile_id.clone()));
|
||||
query = query.filter(pi_dsl::profile_id.eq_any(profile_id.clone()));
|
||||
}
|
||||
|
||||
query = match (params.starting_at, ¶ms.starting_after_id) {
|
||||
@ -758,7 +758,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
|
||||
}
|
||||
|
||||
if let Some(profile_id) = ¶ms.profile_id {
|
||||
query = query.filter(pi_dsl::profile_id.eq(profile_id.clone()));
|
||||
query = query.filter(pi_dsl::profile_id.eq_any(profile_id.clone()));
|
||||
}
|
||||
|
||||
query = match (params.starting_at, ¶ms.starting_after_id) {
|
||||
@ -922,7 +922,7 @@ impl<T: DatabaseStore> PaymentIntentInterface for crate::RouterStore<T> {
|
||||
query = query.filter(pi_dsl::customer_id.eq(customer_id.clone()));
|
||||
}
|
||||
if let Some(profile_id) = ¶ms.profile_id {
|
||||
query = query.filter(pi_dsl::profile_id.eq(profile_id.clone()));
|
||||
query = query.filter(pi_dsl::profile_id.eq_any(profile_id.clone()));
|
||||
}
|
||||
|
||||
query = match params.starting_at {
|
||||
|
||||
Reference in New Issue
Block a user