feat(router): adding generic tokenization endpoint (#7905)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Shivansh Mathur
2025-05-27 11:39:36 +05:30
committed by GitHub
parent c4a5e3ac16
commit 49a178ed20
60 changed files with 1450 additions and 38 deletions

View File

@ -32,6 +32,9 @@ pub mod utils;
use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState};
use database::store::PgPool;
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
use diesel_models::tokenization::Tokenization;
pub mod tokenization;
#[cfg(not(feature = "payouts"))]
use hyperswitch_domain_models::{PayoutAttemptInterface, PayoutsInterface};
pub use mock_db::MockDb;
@ -502,3 +505,14 @@ impl UniqueConstraints for diesel_models::Customer {
impl<T: DatabaseStore> PayoutAttemptInterface for RouterStore<T> {}
#[cfg(not(feature = "payouts"))]
impl<T: DatabaseStore> PayoutsInterface for RouterStore<T> {}
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
impl UniqueConstraints for diesel_models::tokenization::Tokenization {
fn unique_constraints(&self) -> Vec<String> {
vec![format!("id_{}", self.id.get_string_repr())]
}
fn table_name(&self) -> &str {
"tokenization"
}
}