mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
chore: run formatter
This commit is contained in:
@ -2822,16 +2822,7 @@ pub struct VaultToken {
|
|||||||
pub card_holder_name: Option<Secret<String>>,
|
pub card_holder_name: Option<Secret<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Default, Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||||
Default,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
serde::Deserialize,
|
|
||||||
serde::Serialize,
|
|
||||||
ToSchema,
|
|
||||||
)]
|
|
||||||
pub struct NetworkTokenData {
|
pub struct NetworkTokenData {
|
||||||
/// The network token
|
/// The network token
|
||||||
#[schema(value_type = String, example = "4242424242424242")]
|
#[schema(value_type = String, example = "4242424242424242")]
|
||||||
@ -3342,7 +3333,7 @@ pub enum AdditionalPaymentData {
|
|||||||
NetworkToken {
|
NetworkToken {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
details: Option<NetworkTokenData>,
|
details: Option<NetworkTokenData>,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AdditionalPaymentData {
|
impl AdditionalPaymentData {
|
||||||
@ -7196,9 +7187,8 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse {
|
|||||||
}
|
}
|
||||||
AdditionalPaymentData::NetworkToken { details } => {
|
AdditionalPaymentData::NetworkToken { details } => {
|
||||||
Self::NetworkToken(Box::new(NetworkTokenResponse {
|
Self::NetworkToken(Box::new(NetworkTokenResponse {
|
||||||
token_last_four: details
|
token_last_four: details.clone().map(|dt| {
|
||||||
.clone()
|
dt.network_token
|
||||||
.map(|dt| dt.network_token
|
|
||||||
.peek()
|
.peek()
|
||||||
.clone()
|
.clone()
|
||||||
.chars()
|
.chars()
|
||||||
@ -7207,7 +7197,8 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse {
|
|||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
.chars()
|
.chars()
|
||||||
.rev()
|
.rev()
|
||||||
.collect::<String>()),
|
.collect::<String>()
|
||||||
|
}),
|
||||||
token_exp_month: details.clone().map(|dt| dt.token_exp_month.clone()),
|
token_exp_month: details.clone().map(|dt| dt.token_exp_month.clone()),
|
||||||
token_exp_year: details.clone().map(|dt| dt.token_exp_year.clone()),
|
token_exp_year: details.clone().map(|dt| dt.token_exp_year.clone()),
|
||||||
token_cryptogram: details.clone().and_then(|dt| dt.token_cryptogram.clone()),
|
token_cryptogram: details.clone().and_then(|dt| dt.token_cryptogram.clone()),
|
||||||
|
|||||||
@ -210,7 +210,9 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet
|
|||||||
global_enums::PaymentMethodType::BhnCardNetwork => {
|
global_enums::PaymentMethodType::BhnCardNetwork => {
|
||||||
Ok(dirval!(GiftCardType = BhnCardNetwork))
|
Ok(dirval!(GiftCardType = BhnCardNetwork))
|
||||||
}
|
}
|
||||||
global_enums::PaymentMethodType::NetworkToken => Ok(dirval!(NetworkTokenType = NetworkToken)),
|
global_enums::PaymentMethodType::NetworkToken => {
|
||||||
|
Ok(dirval!(NetworkTokenType = NetworkToken))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,9 +172,11 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
|
|||||||
| api_enums::PaymentMethod::Voucher
|
| api_enums::PaymentMethod::Voucher
|
||||||
| api_enums::PaymentMethod::OpenBanking
|
| api_enums::PaymentMethod::OpenBanking
|
||||||
| api_enums::PaymentMethod::GiftCard
|
| api_enums::PaymentMethod::GiftCard
|
||||||
| api_enums::PaymentMethod::NetworkToken => Err(KgraphError::ContextConstructionError(
|
| api_enums::PaymentMethod::NetworkToken => {
|
||||||
Box::new(AnalysisErrorType::NotSupported),
|
Err(KgraphError::ContextConstructionError(Box::new(
|
||||||
)),
|
AnalysisErrorType::NotSupported,
|
||||||
|
)))
|
||||||
|
}
|
||||||
},
|
},
|
||||||
api_enums::PaymentMethodType::Bacs => match self.1 {
|
api_enums::PaymentMethodType::Bacs => match self.1 {
|
||||||
api_enums::PaymentMethod::BankDebit => Ok(dirval!(BankDebitType = Bacs)),
|
api_enums::PaymentMethod::BankDebit => Ok(dirval!(BankDebitType = Bacs)),
|
||||||
@ -192,9 +194,11 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
|
|||||||
| api_enums::PaymentMethod::Voucher
|
| api_enums::PaymentMethod::Voucher
|
||||||
| api_enums::PaymentMethod::OpenBanking
|
| api_enums::PaymentMethod::OpenBanking
|
||||||
| api_enums::PaymentMethod::GiftCard
|
| api_enums::PaymentMethod::GiftCard
|
||||||
| api_enums::PaymentMethod::NetworkToken => Err(KgraphError::ContextConstructionError(
|
| api_enums::PaymentMethod::NetworkToken => {
|
||||||
Box::new(AnalysisErrorType::NotSupported),
|
Err(KgraphError::ContextConstructionError(Box::new(
|
||||||
)),
|
AnalysisErrorType::NotSupported,
|
||||||
|
)))
|
||||||
|
}
|
||||||
},
|
},
|
||||||
api_enums::PaymentMethodType::Becs => Ok(dirval!(BankDebitType = Becs)),
|
api_enums::PaymentMethodType::Becs => Ok(dirval!(BankDebitType = Becs)),
|
||||||
api_enums::PaymentMethodType::Sepa => Ok(dirval!(BankDebitType = Sepa)),
|
api_enums::PaymentMethodType::Sepa => Ok(dirval!(BankDebitType = Sepa)),
|
||||||
|
|||||||
Reference in New Issue
Block a user