text
stringlengths
70
351k
source
stringclasses
4 values
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/recovery_incoming.rs | crate: router }) } } pub struct BillingConnectorPaymentsSyncResponseData( revenue_recovery_response::BillingConnectorPaymentsSyncResponse, ); pub struct BillingConnectorPaymentsSyncFlowRouterData( router_type...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/recovery_incoming.rs | crate: router "Failed to get recovery attempt details from the billing connector", ) .map(RevenueRecoveryAttempt) }, |data| { Ok(Self(rev...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/recovery_incoming.rs | crate: router use hyperswitch_domain_models::{ errors::api_error_response, revenue_recovery, router_data_v2::flow_common_types, router_flow_types, router_request_types::revenue_recovery as revenue_recovery_request, ro...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/recovery_incoming.rs | crate: router use hyperswitch_domain_models::{ errors::api_error_response, revenue_recovery, router_data_v2::flow_common_types, router_flow_types, router_request_types::revenue_recovery as revenue_recovery_request, ro...
ast_fragments
// file: hyperswitch/crates/router/src/core/webhooks/recovery_incoming.rs | crate: router use api_models::{payments as api_payments, webhooks}; use hyperswitch_domain_models::{ errors::api_error_response, revenue_recovery, router_data_v2::flow_common_types, router_flow_types, router_request_types::revenue_recov...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/recovery_incoming.rs | crate: router use std::{marker::PhantomData, str::FromStr}; use api_models::{payments as api_payments, webhooks}; use common_utils::{ ext_traits::{AsyncExt, ValueExt}, id_type, }; use diesel_models::{process_tracker as st...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use hyperswitch_domain_models::{ mandates::CommonMandateReference, payments::{payment_attempt::PaymentAttempt, HeaderPayload}, router_request_ty...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use std::{str::FromStr, time::Instant}; use api_models::payouts as payout_models; use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use crate::{ consts, core::{ api_locking, errors::...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router )) .await?; } Ok(WebhookResponseTracker::Payment { payment_id, status }) } _ => Err(errors::ApiErrorResponse::WebhookProcessingFailure) .a...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router )?, } } else { logger::error!("Webhook source verification failed for frm webhooks flow"); Err(report!( errors::ApiErrorResponse::WebhookAuthenticationFailed )) ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router id, merchant_account.get_id(), merchant_account.storage_scheme, ) .await .to_not_found_response(errors::ApiErrorResponse::WebhookResourceNot...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router | webhooks::WebhookFlow::Subscription | webhooks::WebhookFlow::ReturnResponse | webhooks::WebhookFlow::BankTransfer | webhooks::WebhookFlow::Mandate | webhooks::WebhookFlow::ExternalAu...
ast_fragments
// file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use api_models::webhooks::{self, WebhookResponseTracker}; use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use hyperswitch_interfaces::webhooks::{IncomingWebhookFlowError, IncomingWebhookRequestDetails}; use super::{type...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use std::{str::FromStr, time::Instant}; use api_models::payouts as payout_models; use api_models::webhooks::{self, WebhookResponseTracker}; use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use error_stack:...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use std::{str::FromStr, time::Instant}; use actix_web::FromRequest; use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use router_env::{instrument, tracing, tracing_actix_web::RequestId}; use super::{types, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router let (connector, connector_name) = get_connector_by_connector_name(state, &mca.connector_name, Some(mca.get_id()))?; Ok((Some(mca), connector, connector_name)) } else { // Merchant con...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router } } else { logger::error!( "Webhook source verification failed for external authentication webhook flow" ); Err(report!( errors::ApiErrorResponse::WebhookAuthentica...
ast_fragments
// file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use api_models::webhooks::{self, WebhookResponseTracker}; use hyperswitch_interfaces::webhooks::{IncomingWebhookFlowError, IncomingWebhookRequestDetails}; use crate::{ consts, core::{ api_locking, errors::{self, Con...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router get_connector_by_connector_name(state, connector_name_or_mca_id, None)?; Ok((None, connector, connector_name)) } } fn should_update_connector_mandate_details( source_verified: bool, event_typ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router payment_id: dispute_object.payment_id, status: dispute_object.dispute_status, }) } else { metrics::INCOMING_DISPUTE_WEBHOOK_SIGNATURE_FAILURE_METRIC.add(1, &[]); Err(report...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router status: updated_mandate.mandate_status, }) } else { logger::error!("Webhook source verification failed for mandates webhook flow"); Err(report!( errors::ApiErrorResponse::W...
ast_fragments
// file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router } } else { logger::error!( "Webhook source verification failed for external authentication webhook flow" ); Err(report!( errors::ApiErrorResponse::WebhookAuthenticationFailed ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use std::{str::FromStr, time::Instant}; use api_models::payouts as payout_models; use api_models::webhooks::{self, WebhookResponseTracker}; use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use hyperswitch_...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router Ok(WebhookResponseTracker::Payout { payout_id: updated_payout_attempt.payout_id, status: updated_payout_attempt.status, }) } else { metrics::INCOMING_PAYOUT_WEBHOOK_SIGNATU...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router use api_models::payouts as payout_models; use api_models::webhooks::{self, WebhookResponseTracker}; use common_utils::{errors::ReportSwitchExt, events::ApiEventsType}; use error_stack::{report, ResultExt}; use hyperswitch_in...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router Ok(( response, WebhookResponseTracker::NoEffect, serde_json::Value::Null, )) } else { Err(error) } } #[allow(clippy::too_many_arguments)] #[instrument(skip...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router challenge_required_by: dispute_details.challenge_required_by, connector_updated_at: dispute_details.updated_at, }; db.update_dispute(dispute, update_dispute) ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/incoming.rs | crate: router auth_type, None, api_event, req, req.method(), ); state.event_handler().log_event(&api_event); Ok(application_response) } #[allow(clippy::too_many_arguments)] #[instrument...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/webhook_events.rs | crate: router use common_utils::{self, fp_utils}; use crate::{ core::errors::{self, RouterResponse, StorageErrorExt}, routes::SessionState, services::ApplicationResponse, types::{api, domain, storage, transformers::F...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/webhook_events.rs | crate: router use common_utils::{self, fp_utils}; use error_stack::ResultExt; use crate::{ core::errors::{self, RouterResponse, StorageErrorExt}, routes::SessionState, services::ApplicationResponse, types::{api, doma...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/webhook_events.rs | crate: router use common_utils::{self, fp_utils}; use crate::{ core::errors::{self, RouterResponse, StorageErrorExt}, routes::SessionState, services::ApplicationResponse, types::{api, domain, storage, transformers::F...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/webhook_events.rs | crate: router use common_utils::{self, fp_utils}; use crate::{ core::errors::{self, RouterResponse, StorageErrorExt}, routes::SessionState, services::ApplicationResponse, types::{api, domain, storage, transformers::F...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/webhook_events.rs | crate: router use common_utils::{self, fp_utils}; use crate::{ core::errors::{self, RouterResponse, StorageErrorExt}, routes::SessionState, services::ApplicationResponse, types::{api, domain, storage, transformers::F...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/utils.rs | crate: router use std::marker::PhantomData; use common_utils::{errors::CustomResult, ext_traits::ValueExt}; use crate::{ core::{ errors::{self}, payments::helpers, }, db::{get_and_deserialize_key, StorageInterface...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/utils.rs | crate: router use common_utils::{errors::CustomResult, ext_traits::ValueExt}; use crate::{ core::{ errors::{self}, payments::helpers, }, db::{get_and_deserialize_key, StorageInterface}, services::logger, t...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/utils.rs | crate: router use common_utils::{errors::CustomResult, ext_traits::ValueExt}; use crate::{ core::{ errors::{self}, payments::helpers, }, db::{get_and_deserialize_key, StorageInterface}, services::logger, t...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/utils.rs | crate: router use common_utils::{errors::CustomResult, ext_traits::ValueExt}; use crate::{ core::{ errors::{self}, payments::helpers, }, db::{get_and_deserialize_key, StorageInterface}, services::logger, t...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/webhooks/utils.rs | crate: router use std::marker::PhantomData; use common_utils::{errors::CustomResult, ext_traits::ValueExt}; use error_stack::ResultExt; use crate::{ core::{ errors::{self}, payments::helpers, }, db::{get_and_deser...
ast_fragments
// file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use diesel_models::payment_method; use hyperswitch_domain_models::customer::CustomerUpdate; use masking::Secret; use super::tokenize::NetworkTokenizationProcess; use crate::core::payment_methods::{ add_payment_method_status_update_...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router ); let builder = tokenize::NetworkTokenizationBuilder::<tokenize::TokenizeWithPmId>::default(); execute_payment_method_tokenization(executor, builder, payment_method).a...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .map(|country_code| CountryCodeWithName { code: country_code, name: common_enums::Country::from_alpha2(country_code), }) .collect(), } } #[cfg(all(...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router Ok(services::ApplicationResponse::Json( list_countries_currencies_for_connector_payment_method_util( state.conf.pm_filters.clone(), req.connector, req.payment_method_type, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed to update the default payment method id for the customer")?; }; Ok(services::ApplicationResponse::Json( ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router 1, router_env::metric_attributes!(("flow", "DeleteTokenizeData")), ); Ok(card) } } #[cfg(all( any(feature = "v2", feature = "v1"), not(feature = "payment_methods_v2") ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router #[cfg(all( any(feature = "v2", feature = "v1"), not(feature = "payment_methods_v2") ))] pub struct TempLockerCardSupport; #[cfg(all( any(feature = "v2", feature = "v1"), not(feature = "payment_methods_v2...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router key_store, payment_method.clone(), update_last_used, storage_scheme, ) .await .change_context(errors::ApiErrorResponse::InternalServerError) ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router })), PaymentMethodsData::WalletDetails(_) => Ok(None), }, None => Err(report!(errors::ApiErrorResponse::InternalServerError)) .attach_printable("Unable to fetch payment...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router let resp = TempLockerCardSupport::create_payment_method_data_in_temp_locker( state, payment_token, card, pm, merchant_key_store, ) .await?; Ok(resp) } pub async f...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router return true; } match connector_mandate_details { Some(connector_mandate_details) => merchant_connector_accounts .is_merchant_connector_account_id_in_connector_mandate_details( ...
ast_fragments
// file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router pub async fn perform_surcharge_ops( _payment_intent: Option<storage::PaymentIntent>, _state: &routes::SessionState, _merchant_account: &domain::MerchantAccount, _key_store: domain::MerchantKeyStore, _business_profil...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use error_stack::{report, ResultExt}; use crate::routes::app::SessionStateInfo; use crate::types::domain::types::AsyncLift; use crate::{ configs::{ defaults::{get_billing_required_fields, get_shipping_require...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router fn filter_recurring_based( payment_method: &RequestPaymentMethodTypes, recurring_enabled: Option<bool>, ) -> bool { recurring_enabled.map_or(true, |enabled| payment_method.recurring_enabled == enabled) } #[c...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use super::surcharge_decision_configs::{ perform_surcharge_decision_management_for_payment_method_list, perform_surcharge_decision_management_for_saved_cards, }; use crate::routes::app::SessionStateInfo; use crat...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router let client_secret_expired = authenticate_pm_client_secret_and_check_expiry(cs, &payment_method)?; if client_secret_expired { return Err::<(), error_stack::Report<errors::ApiErrorResponse>>( ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use std::{ collections::{HashMap, HashSet}, fmt::Debug, str::FromStr, }; use diesel_models::payment_method; use error_stack::{report, ResultExt}; use crate::routes::app::SessionStateInfo; use crate::types::do...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router collect_shipping_details_from_wallets, collect_billing_details_from_wallets, is_tax_calculation_enabled: is_tax_connector_enabled && !skip_external_tax_calculation, }, )) }...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router let locker_mock_up = db .delete_locker_mock_up(card_id) .await .change_context(errors::VaultError::FetchCardFailed)?; Ok(payment_methods::DeleteCardResponse { card_id: Some(locker_...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router customer_id: locker_mock_up.customer_id, duplicate: locker_mock_up.duplicate, }; Ok(( payment_methods::GetCardResponse { card: add_card_response, }, locker_mock...
ast_fragments
// file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router card_reference: response.card_id, duplication_check: None, }; Ok(payment_methods::StoreCardResp { status: "Ok".to_string(), error_code: None, error_message: None, payload: Some(pa...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router #[cfg(all(feature = "v2", feature = "customer_v2"))] #[instrument(skip_all)] pub async fn delete_card_from_hs_locker_by_global_id<'a>( state: &routes::SessionState, id: &str, merchant_id: &id_type::MerchantId...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router retrieve_card_resp .card .get_required_value("Card") .change_context(errors::VaultError::FetchCardFailed) } else { let (get_card_resp, _) = mock_get_card(&*state.st...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .transpose()?; let pm_update = payment_method::PaymentMethodUpdate::ConnectorMandateDetailsUpdate { connector_mandate_details: connector_mandate_details_value, }; db.update_payment_method(&(...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use common_enums::{enums::MerchantStorageScheme, ConnectorType}; use diesel_models::payment_method; use hyperswitch_domain_models::mandates::CommonMandateReference; use router_env::{instrument, tracing}; use crate::route...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router let card_id = generate_id(consts::ID_LENGTH, "card"); mock_call_to_locker_hs(db, &card_id, payload, None, None, Some(customer_id)).await? }; let stored_card = stored_card_response .payloa...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router )?; decode_and_decrypt_locker_data(state, key_store, enc_card_data.peek().to_string()).await? } else { mock_get_payment_method(state, key_store, payment_method_reference) .awai...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router key, ) .await .and_then(|val| val.try_into_optionaloperation()) .change_context(errors::VaultError::FetchPaymentMethodFailed)? .map_or( Err(report!(errors::VaultError::FetchPaymentMeth...
ast_fragments
// file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router add_card_to_hs_locker(state, &payload, customer_id, locker_choice).await?; let payment_method_resp = payment_methods::mk_add_card_response_hs( card.clone(), store_card_payload.card_reference, req, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router } #[cfg(all(feature = "v2", feature = "customer_v2"))] pub async fn delete_card_by_locker_id( state: &routes::SessionState, id: &id_type::GlobalCustomerId, merchant_id: &id_type::MerchantId, ) -> errors::Rou...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router ); }) }, &metrics::CARD_GET_TIME, router_env::metric_attributes!(("locker", "rust")), ) .await?; logger::debug!("card retrieved from rust locker"); Ok(...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router ); }) }, &metrics::CARD_ADD_TIME, router_env::metric_attributes!(("locker", "rust")), )) .await?; logger::debug!("card added to hyperswitch-card-vault"); ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router ) .await?; let payment_method_resp = payment_methods::mk_add_bank_response_hs( bank.clone(), store_resp.card_reference, req, merchant_account.get_id(), ); Ok((payment_m...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router #[cfg(all(feature = "v2", feature = "payment_methods_v2"))] pub fn validate_payment_method_update( _card_updation_obj: CardDetailUpdate, _existing_card_data: api::CardDetailFromLocker, ) -> bool { todo!() } ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router Ok(services::ApplicationResponse::Json(response)) } else { Err(report!(errors::ApiErrorResponse::NotSupported { message: "Payment method update for the given payment method is not supporte...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .and_then(|val| (!val.0.is_empty()).then_some(false)) }), ); Ok(services::ApplicationResponse::Json(resp)) } #[cfg(all( any(feature = "v1", feature = "v2"), not(feature =...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .attach_printable( "Failed to add payment method status update task in process tracker", )?; } Ok(services::api::ApplicationResponse::Json( api::Paymen...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router cards::validate::validate_card_number_chars(&card_isin) .and_then(|_| cards::validate::validate_card_number_chars(&last4_digits))?; Ok((card_isin, last4_digits)) } #[cfg(all( any(feature = "v1", fe...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router #[cfg(all( any(feature = "v1", feature = "v2"), not(feature = "payment_methods_v2") ))] impl ForeignTryFrom<( &api_models::payment_methods::MigrateCardDetail, Option<diesel_models::CardInfo>,...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router _req: api::PaymentMethodMigrate, _merchant_id: &id_type::MerchantId, _merchant_account: &domain::MerchantAccount, _key_store: &domain::MerchantKeyStore, ) -> errors::RouterResponse<api::PaymentMethodMigra...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router _merchant_id: &id_type::MerchantId, ) -> ( api::PaymentMethodResponse, Option<payment_methods::DataDuplicationCheck>, ) { todo!() } #[cfg(all( any(feature = "v1", feature = "v2"), not(feature = "p...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router storage_scheme, ) .await .map_err(|error| logger::error!(?error, "Failed to set the payment method as default")); } Ok(response) } #[cfg(all( any(feature = "v1", feature =...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router &customer.id, ) .await?; let builder = builder.set_payment_method_response(&payment_method); Ok(builder.build()) } #[cfg(all( any(feature = "v1", feature = "v2"), not(feature...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router ); let builder = tokenize::NetworkTokenizationBuilder::<tokenize::TokenizeWithPmId>::default(); execute_payment_method_tokenization(executor, builder, payment_method).a...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router domain::types::CryptoOperation::Encrypt(secret_data), identifier.clone(), key, ) .await .and_then(|val| val.try_into_operation()) .change_context(errors::StorageError::EncryptionEr...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .attach_printable("Failed to update the default payment method id for the customer")?; let resp = api_models::payment_methods::CustomerDefaultPaymentMethodResponse { default_payment_method_id: update...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use std::{ collections::{HashMap, HashSet}, fmt::Debug, str::FromStr, }; use crate::routes::app::SessionStateInfo; use crate::types::domain::types::AsyncLift; use crate::{ configs::{ defaults::{ge...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router } else { logger::debug!( "Getting card details from locker as it is not found in payment methods table" ); get_card_details_from_locker(state, pm).await? }) } #[cfg(all( a...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router } else { logger::debug!( "Getting card details from locker as it is not found in payment methods table" ); Some(get_card_details_from_locker(state, pm).await?) }) } #[cfg(all(...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router decrypted_data .map(|decrypted_data| decrypted_data.into_inner().expose()) .map(|decrypted_value| decrypted_value.parse_value("generic_data")) .transpose() .change_context(errors::ApiE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router return Ok( mcas.is_merchant_connector_account_id_in_connector_mandate_details( profile_id.as_ref(), &connector_mandate_details, ), ); } Ok(f...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use error_stack::{report, ResultExt}; use crate::routes::app::SessionStateInfo; use crate::types::domain::types::AsyncLift; use crate::{ configs::{ defaults::{get_billing_required_fields, get_shipping_require...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use api_models::{ enums as api_enums, payment_methods::{ BankAccountTokenData, Card, CardDetailUpdate, CardDetailsPaymentMethod, CardNetworkTypes, CountryCodeWithName, ListCountriesCurrenciesReque...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use api_models::{ enums as api_enums, payment_methods::{ BankAccountTokenData, Card, CardDetailUpdate, CardDetailsPaymentMethod, CardNetworkTypes, CountryCodeWithName, ListCountriesCurrenciesReque...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use api_models::{ enums as api_enums, payment_methods::{ BankAccountTokenData, Card, CardDetailUpdate, CardDetailsPaymentMethod, CardNetworkTypes, CountryCodeWithName, ListCountriesCurrenciesReque...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use api_models::{ enums as api_enums, payment_methods::{ BankAccountTokenData, Card, CardDetailUpdate, CardDetailsPaymentMethod, CardNetworkTypes, CountryCodeWithName, ListCountriesCurrenciesReque...
ast_fragments
// file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use api_models::{ enums as api_enums, payment_methods::{ BankAccountTokenData, Card, CardDetailUpdate, CardDetailsPaymentMethod, CardNetworkTypes, CountryCodeWithName, ListCountriesCurrenciesRequest, ListCountri...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router } } } } } Ok(()) } // v2 type for PaymentMethodListRequest will not have the installment_payment_enabled field, // need to re-evaluate filter logic #[cfg(a...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router use std::{ collections::{HashMap, HashSet}, fmt::Debug, str::FromStr, }; use serde_json::json; fn get_val(str: String, val: &serde_json::Value) -> Option<String> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router ) -> errors::CustomResult<payment_methods::DeleteCardResp, errors::VaultError> { db.delete_locker_mock_up(card_id) .await .change_context(errors::VaultError::FetchCardFailed)?; Ok(payment_methods::DeleteCardResp...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router merchant_id: Some(locker_mock_up.merchant_id.to_owned()), nickname: locker_mock_up.nickname, customer_id: locker_mock_up.customer_id, duplicate: locker_mock_up.duplicate, payment_m...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/core/payment_methods/cards.rs | crate: router .await .change_context(errors::VaultError::DeleteCardFailed) } else { Ok(mock_delete_card_hs(&*state.store, card_reference) .await .change_context(errors::VaultError::D...
ast_fragments