text
stringlengths
70
351k
source
stringclasses
4 values
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::BankRedirectData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: Box<api_models::payments::SamsungPayWalletData>) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::Card) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(api_model_payment_method_data: api_models::payments::PaymentMethodData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn try_from(value: payment_methods::PaymentMethodCreateData) -> Result<Self, Self::Error> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; use common_enums::enums as api_enums; use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; fn get_payment_method_type(&self) -> api_enums::PaymentMethodType { { Self::Boleto(_) => api_enums::PaymentMethodType::Boleto,<|fim_suffix|> <|fim_middle|> Self::PayEasy(_) => api_enums::PaymentMethodType::PayEasy, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; use common_enums::enums as api_enums; use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; fn get_payment_method_type(&self) -> api_enums::PaymentMethodType { { Self::AchBankTransfer { .. } => api_enums::PaymentMethodType::Ach,<|fim_suffix|> <|fim_middle|> Self::InstantBankTransfer {} => api_enums::PaymentMethodType::InstantBankTransfer, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; pub fn get_store_key(&self) -> &str { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; pub fn store_key(payment_method_id: &id_type::GlobalPaymentMethodId) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(item: NetworkTokenDetailsPaymentMethod) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; use masking::{PeekInterface, Secret}; pub fn get_single_use_token_from_payment_method_token( token: Secret<String>, mca_id: id_type::MerchantConnectorAccountId, ) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(item: NetworkTokenDetails) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(item: payment_methods::CardDetail) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn saved_in_locker_default() -> bool { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(item: GooglePayWalletData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: Card) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; use common_enums::enums as api_enums; use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; fn get_payment_method_type(&self) -> api_enums::PaymentMethodType { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: MobilePaymentData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::MobilePaymentData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: OpenBankingData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::OpenBankingData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: RealTimePaymentData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::RealTimePaymentData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: CardToken) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::CardToken) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: GiftCardData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::GiftCardData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: VoucherData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(_value: Box<JCSVoucherData>) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(_value: Box<IndomaretVoucherData>) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(_value: Box<AlfamartVoucherData>) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: Box<BoletoVoucherData>) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
// file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; fn from(value: UpiData) -> Self { match value { UpiData::UpiCollect(upi) => Self::UpiCollect(Box::new( payment_additional_types::UpiCollectAdditionalData { vpa_id: upi.vpa_id.map(MaskedUpiVpaId::from), }, )), UpiData::UpiIntent(_) => { Self::UpiIntent(Box::new(api_models::payments::UpiIntentData {})) } } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::UpiData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: CryptoData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::CryptoData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::PayLaterData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::PazeWalletData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(samsung_pay_token_data: api_models::payments::SamsungPayTokenData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::ApplePayWalletData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::GooglePayWalletData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(value: CardRedirectData) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::CardRedirectData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(card_details_for_nti: mandates::NetworkTransactionIdAndCardDetails) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models fn from(item: &Card) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; pub fn get_nti_and_card_details_for_mit_flow( recurring_details: mandates::RecurringDetails, ) -> Option<(api_models::payments::MandateReferenceId, Self)> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; use common_utils::{ id_type, new_type::{ MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId, }, pii::{self, Email}, }; pub fn is_network_token_payment_method_data(&self) -> bool { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs | crate: hyperswitch_domain_models use api_models::{ mandates, payment_methods::{self}, payments::{ additional_info as payment_additional_types, AmazonPayRedirectData, ExtendedCardInfo, }, }; fn from(value: api_models::payments::WalletData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/routing.rs | crate: hyperswitch_domain_models fn from(value: PaymentRoutingInfoSerde) -> Self { { PaymentRoutingInfoSerde::OnlyAlgorithm(algo) => Self { algorithm: Some(*algo), pre_routing_results: None, },<|fim_suffix|> <|fim_middle|> PaymentRoutingInfoSerde::WithDetails(details) => Self { algorithm: details.algorithm, pre_routing_results: details.pre_routing_results, }, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/routing.rs | crate: hyperswitch_domain_models fn from(value: PaymentRoutingInfo) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/routing.rs | crate: hyperswitch_domain_models fn from(value: PaymentRoutingInfoSerde) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: AcceptanceType) -> Self { { AcceptanceType::Online => Self::Online,<|fim_suffix|> <|fim_middle|> AcceptanceType::Offline => Self::Offline, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: ApiAcceptanceType) -> Self { { ApiAcceptanceType::Online => Self::Online,<|fim_suffix|> <|fim_middle|> ApiAcceptanceType::Offline => Self::Offline, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: PaymentsMandateReferenceRecord) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: ConnectorTokenReferenceRecord) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::PaymentsMandateReferenceRecord) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::ConnectorTokenReferenceRecord) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: PayoutsMandateReferenceRecord) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::PayoutsMandateReferenceRecord) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: PaymentsTokenReference) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::PaymentsTokenReference) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: PaymentsMandateReference) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::PaymentsMandateReference) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: PayoutsMandateReference) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::PayoutsMandateReference) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: CommonMandateReference) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: diesel_models::CommonMandateReference) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use std::collections::HashMap; use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; use common_utils::{ date_time, errors::{CustomResult, ParsingError}, pii, types::MinorUnit, }; /// Insert a new payment token reference for the given connector_id pub fn insert_payment_token_reference_record( &mut self, connector_id: &common_utils::id_type::MerchantConnectorAccountId, record: ConnectorTokenReferenceRecord, ) { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; use common_utils::{ date_time, errors::{CustomResult, ParsingError}, pii, types::MinorUnit, }; pub fn get_mandate_details_value(&self) -> CustomResult<serde_json::Value, ParsingError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use common_utils::{ date_time, errors::{CustomResult, ParsingError}, pii, types::MinorUnit, }; use error_stack::ResultExt; pub fn get_end_date( &self, format: date_time::DateFormat, ) -> error_stack::Result<Option<String>, ParsingError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use common_utils::{ date_time, errors::{CustomResult, ParsingError}, pii, types::MinorUnit, }; use time::PrimitiveDateTime; pub fn get_accepted_at(&self) -> PrimitiveDateTime { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models pub fn get_user_agent(&self) -> Option<String> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models pub fn get_ip_address(&self) -> Option<String> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: OnlineMandate) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: ApiOnlineMandate) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: AcceptanceType) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: ApiAcceptanceType) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: CustomerAcceptance) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: ApiCustomerAcceptance) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: ApiMandateData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: diesel_models::enums::MandateAmountData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
// file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: MandateAmountData) -> Self { Self { amount: value.amount, currency: value.currency, start_date: value.start_date, end_date: value.end_date, metadata: value.metadata, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(value: ApiMandateAmountData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use std::collections::HashMap; use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; use common_enums::Currency; use common_utils::{ date_time, errors::{CustomResult, ParsingError}, pii, types::MinorUnit, }; use error_stack::ResultExt; use masking::{PeekInterface, Secret}; use time::PrimitiveDateTime; fn from(value: diesel_models::enums::MandateDataType) -> Self { { DieselMandateDataType::SingleUse(data) => Self::SingleUse(data.into()),<|fim_suffix|> <|fim_middle|> DieselMandateDataType::MultiUse(Some(data)) => Self::MultiUse(Some(data.into())), } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: MandateDataType) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models use api_models::payments::{ AcceptanceType as ApiAcceptanceType, CustomerAcceptance as ApiCustomerAcceptance, MandateAmountData as ApiMandateAmountData, MandateData as ApiMandateData, MandateType, OnlineMandate as ApiOnlineMandate, }; fn from(mandate_type: MandateType) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: diesel_models::enums::MandateDetails) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs | crate: hyperswitch_domain_models fn from(value: MandateDetails) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/api.rs | crate: hyperswitch_domain_models use common_utils::{ events::{ApiEventMetric, ApiEventsType}, impl_api_event_type, }; fn get_api_event_type(&self) -> Option<ApiEventsType> { { Self::Json(r) => r.get_api_event_type(),<|fim_suffix|> <|fim_middle|> _ => None, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/api.rs | crate: hyperswitch_domain_models use common_utils::{ events::{ApiEventMetric, ApiEventsType}, impl_api_event_type, }; pub fn get_json_body( self, ) -> common_utils::errors::CustomResult<R, common_utils::errors::ValidationError> { { Self::Json(body) | Self::JsonWithHeaders((body, _)) => Ok(body),<|fim_suffix|> <|fim_middle|> Self::TextPlain(_) | Self::JsonForRedirection(_) | Self::Form(_) | Self::PaymentLinkForm(_) | Self::FileData(_) | Self::GenericLinkForm(_) | Self::StatusOk => Err(common_utils::errors::ValidationError::InvalidValue { message: "expected either Json or JsonWithHeaders Response".to_string(), } .into()), } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/api.rs | crate: hyperswitch_domain_models use common_utils::{ events::{ApiEventMetric, ApiEventsType}, impl_api_event_type, }; pub fn get_json_body( self, ) -> common_utils::errors::CustomResult<R, common_utils::errors::ValidationError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/vault.rs | crate: hyperswitch_domain_models fn get_vaulting_data_key(&self) -> String { { Self::Card(card) => card.card_number.to_string(),<|fim_suffix|> <|fim_middle|> Self::NetworkToken(network_token) => network_token.network_token.to_string(), } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/vault.rs | crate: hyperswitch_domain_models use crate::payment_method_data; pub fn get_payment_methods_data(&self) -> payment_method_data::PaymentMethodsData { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/vault.rs | crate: hyperswitch_domain_models use api_models::payment_methods; fn from(item: payment_methods::PaymentMethodCreateData) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/vault.rs | crate: hyperswitch_domain_models fn get_vaulting_data_key(&self) -> String { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
// file: hyperswitch/crates/hyperswitch_domain_models/src/vault.rs | crate: hyperswitch_domain_models use crate::payment_method_data; pub fn get_payment_methods_data(&self) -> payment_method_data::PaymentMethodsData { match self { Self::Card(card) => payment_method_data::PaymentMethodsData::Card( payment_method_data::CardDetailsPaymentMethod::from(card.clone()), ), Self::NetworkToken(network_token) => { payment_method_data::PaymentMethodsData::NetworkToken( payment_method_data::NetworkTokenDetailsPaymentMethod::from( network_token.clone(), ), ) } } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/vault.rs | crate: hyperswitch_domain_models use api_models::payment_methods; pub fn get_card(&self) -> Option<&payment_methods::CardDetail> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs | crate: hyperswitch_domain_models use api_models::enums::Connector; use common_utils::{ errors::{CustomResult, ValidationError}, ext_traits::OptionExt, id_type, pii, types::{ keymanager::{self, KeyManagerState}, ConnectorTransactionId, ConnectorTransactionIdTrait, MinorUnit, }, }; use diesel_models::{ ConnectorMandateReferenceId, PaymentAttempt as DieselPaymentAttempt, PaymentAttemptNew as DieselPaymentAttemptNew, PaymentAttemptUpdate as DieselPaymentAttemptUpdate, }; pub fn from_payments_request_and_payment_attempt( payments_request: &api_models::payments::PaymentsRequest, payment_attempt: Option<&PaymentAttempt>, ) -> Option<Self> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs | crate: hyperswitch_domain_models use common_utils::{ errors::{CustomResult, ValidationError}, ext_traits::OptionExt, id_type, pii, types::{ keymanager::{self, KeyManagerState}, ConnectorTransactionId, ConnectorTransactionIdTrait, MinorUnit, }, }; pub fn get_order_amount(&self) -> MinorUnit { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs | crate: hyperswitch_domain_models use common_utils::{ errors::{CustomResult, ValidationError}, ext_traits::OptionExt, id_type, pii, types::{ keymanager::{self, KeyManagerState}, ConnectorTransactionId, ConnectorTransactionIdTrait, MinorUnit, }, }; pub fn new( order_amount: MinorUnit, shipping_cost: Option<MinorUnit>, order_tax_amount: Option<MinorUnit>, surcharge_amount: Option<MinorUnit>, tax_on_surcharge: Option<MinorUnit>, ) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments