chore: v2 api changes for session token endpoint (#6032)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-10-07 20:20:26 +05:30
committed by GitHub
parent f4830ebaae
commit 6e355f34a8
10 changed files with 109 additions and 38 deletions

View File

@ -4505,6 +4505,19 @@ impl From<&VerifyRequest> for MandateValidationFields {
}
}
// #[cfg(all(feature = "v2", feature = "payment_v2"))]
// impl From<PaymentsSessionRequest> for PaymentsSessionResponse {
// fn from(item: PaymentsSessionRequest) -> Self {
// let client_secret: Secret<String, pii::ClientSecret> = Secret::new(item.client_secret);
// Self {
// session_token: vec![],
// payment_id: item.payment_id,
// client_secret,
// }
// }
// }
#[cfg(feature = "v1")]
impl From<PaymentsSessionRequest> for PaymentsSessionResponse {
fn from(item: PaymentsSessionRequest) -> Self {
let client_secret: Secret<String, pii::ClientSecret> = Secret::new(item.client_secret);
@ -4752,6 +4765,11 @@ pub struct RedirectResponse {
pub json_payload: Option<pii::SecretSerdeValue>,
}
#[cfg(feature = "v2")]
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
pub struct PaymentsSessionRequest {}
#[cfg(feature = "v1")]
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
pub struct PaymentsSessionRequest {
/// The identifier for the payment