feat(router): Add new api for delete tokenization record (#8361)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prasunna Soppa
2025-08-11 15:58:36 +05:30
committed by GitHub
parent 4434bf19af
commit 0e95785437
17 changed files with 436 additions and 29 deletions

View File

@ -238,3 +238,9 @@ impl ApiEventMetric for tokenization::GenericTokenizationRequest {}
#[cfg(feature = "tokenization_v2")]
impl ApiEventMetric for tokenization::GenericTokenizationResponse {}
#[cfg(feature = "tokenization_v2")]
impl ApiEventMetric for tokenization::DeleteTokenDataResponse {}
#[cfg(feature = "tokenization_v2")]
impl ApiEventMetric for tokenization::DeleteTokenDataRequest {}

View File

@ -1,5 +1,5 @@
use common_enums;
use common_utils::id_type::{GlobalCustomerId, GlobalTokenId};
use common_utils::id_type;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use utoipa::{schema, ToSchema};
@ -9,7 +9,7 @@ use utoipa::{schema, ToSchema};
pub struct GenericTokenizationResponse {
/// Unique identifier returned by the tokenization service
#[schema(value_type = String, example = "12345_tok_01926c58bc6e77c09e809964e72af8c8")]
pub id: GlobalTokenId,
pub id: id_type::GlobalTokenId,
/// Created time of the tokenization id
#[schema(value_type = PrimitiveDateTime,example = "2024-02-24T11:04:09.922Z")]
pub created_at: PrimitiveDateTime,
@ -22,8 +22,26 @@ pub struct GenericTokenizationResponse {
pub struct GenericTokenizationRequest {
/// Customer ID for which the tokenization is requested
#[schema(value_type = String, example = "12345_cus_01926c58bc6e77c09e809964e72af8c8")]
pub customer_id: GlobalCustomerId,
pub customer_id: id_type::GlobalCustomerId,
/// Request for tokenization which contains the data to be tokenized
#[schema(value_type = Object,example = json!({ "city": "NY", "unit": "245" }))]
pub token_request: masking::Secret<serde_json::Value>,
}
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct DeleteTokenDataRequest {
/// Customer ID for which the tokenization is requested
#[schema(value_type = String, example = "12345_cus_01926c58bc6e77c09e809964e72af8c8")]
pub customer_id: id_type::GlobalCustomerId,
/// Session ID associated with the tokenization request
#[schema(value_type = String, example = "12345_pms_01926c58bc6e77c09e809964e72af8c8")]
pub session_id: id_type::GlobalPaymentMethodSessionId,
}
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct DeleteTokenDataResponse {
/// Unique identifier returned by the tokenization service
#[schema(value_type = String, example = "12345_tok_01926c58bc6e77c09e809964e72af8c8")]
pub id: id_type::GlobalTokenId,
}