feat(router): add profile id and extra filters in lists (#2379)

This commit is contained in:
Apoorv Dixit
2023-10-04 19:39:45 +05:30
committed by GitHub
parent 409913fd75
commit ab2cde7993
15 changed files with 228 additions and 110 deletions

View File

@ -1,4 +1,4 @@
use api_models::enums::{Connector, PaymentMethod};
use api_models::enums::{AuthenticationType, Connector, PaymentMethod, PaymentMethodType};
use common_utils::errors::CustomResult;
use data_models::{
errors,
@ -176,11 +176,20 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
er.change_context(new_err)
})
.map(
|(connector, currency, status, payment_method)| PaymentListFilters {
|(
connector,
currency,
status,
payment_method,
payment_method_type,
authentication_type,
)| PaymentListFilters {
connector,
currency,
status,
payment_method,
payment_method_type,
authentication_type,
},
)
}
@ -248,7 +257,9 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
merchant_id: &str,
active_attempt_ids: &[String],
connector: Option<Vec<Connector>>,
payment_methods: Option<Vec<PaymentMethod>>,
payment_method: Option<Vec<PaymentMethod>>,
payment_method_type: Option<Vec<PaymentMethodType>>,
authentication_type: Option<Vec<AuthenticationType>>,
_storage_scheme: MerchantStorageScheme,
) -> CustomResult<i64, errors::StorageError> {
let conn = self
@ -269,7 +280,9 @@ impl<T: DatabaseStore> PaymentAttemptInterface for RouterStore<T> {
merchant_id,
active_attempt_ids,
connector_strings,
payment_methods,
payment_method,
payment_method_type,
authentication_type,
)
.await
.map_err(|er| {
@ -826,7 +839,9 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
merchant_id: &str,
active_attempt_ids: &[String],
connector: Option<Vec<Connector>>,
payment_methods: Option<Vec<PaymentMethod>>,
payment_method: Option<Vec<PaymentMethod>>,
payment_method_type: Option<Vec<PaymentMethodType>>,
authentication_type: Option<Vec<AuthenticationType>>,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<i64, errors::StorageError> {
self.router_store
@ -834,7 +849,9 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
merchant_id,
active_attempt_ids,
connector,
payment_methods,
payment_method,
payment_method_type,
authentication_type,
storage_scheme,
)
.await