repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 23
values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
hyperswitch | crates/router/src/core/payments/types.rs | .rs | use std::{collections::HashMap, num::TryFromIntError};
use api_models::payment_methods::SurchargeDetailsResponse;
use common_utils::{
errors::CustomResult,
ext_traits::{Encode, OptionExt},
types::{self as common_types, ConnectorTransactionIdTrait},
};
use error_stack::ResultExt;
use hyperswitch_domain_mode... | 3,214 | 1,606 |
hyperswitch | crates/router/src/core/payments/conditional_configs.rs | .rs | use api_models::{conditional_configs::DecisionManagerRecord, routing};
use common_utils::ext_traits::StringExt;
use error_stack::ResultExt;
use euclid::backend::{self, inputs as dsl_inputs, EuclidBackend};
use router_env::{instrument, tracing};
use storage_impl::redis::cache::{self, DECISION_MANAGER_CACHE};
use super:... | 767 | 1,607 |
hyperswitch | crates/router/src/core/payments/tokenization.rs | .rs | use std::collections::HashMap;
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
use api_models::payment_methods::PaymentMethodsData;
use api_models::{
payment_methods::PaymentMethodDataWalletInfo, payments::ConnectorMandateReferenceId,
};
use common_enums::{ConnectorM... | 9,998 | 1,608 |
hyperswitch | crates/router/src/core/payments/payment_methods.rs | .rs | //! Contains functions of payment methods that are used in payments
//! one of such functions is `list_payment_methods`
use common_utils::{ext_traits::OptionExt, id_type};
use error_stack::ResultExt;
use super::errors;
use crate::{db::errors::StorageErrorExt, routes, types::domain};
#[cfg(all(
feature = "v2",
... | 1,571 | 1,609 |
hyperswitch | crates/router/src/core/payments/session_operation.rs | .rs | use std::fmt::Debug;
pub use common_enums::enums::CallConnectorAction;
use common_utils::id_type;
use error_stack::ResultExt;
pub use hyperswitch_domain_models::{
mandates::{CustomerAcceptance, MandateData},
payment_address::PaymentAddress,
payments::HeaderPayload,
router_data::{PaymentMethodToken, Rou... | 1,424 | 1,610 |
hyperswitch | crates/router/src/core/payments/flows/complete_authorize_flow.rs | .rs | use async_trait::async_trait;
use masking::ExposeInterface;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
core::{
errors::{ApiErrorResponse, ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, PaymentData},
},
routes::{metrics, SessionStat... | 2,519 | 1,611 |
hyperswitch | crates/router/src/core/payments/flows/psync_flow.rs | .rs | use std::collections::HashMap;
use async_trait::async_trait;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
connector::utils::RouterData,
core::{
errors::{ApiErrorResponse, ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, PaymentData},
... | 2,295 | 1,612 |
hyperswitch | crates/router/src/core/payments/flows/session_update_flow.rs | .rs | use async_trait::async_trait;
use super::ConstructFlowSpecificData;
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, Feature, PaymentData},
},
routes::SessionState,
services,
types::{self, api, domain},
};
#[async... | 1,025 | 1,613 |
hyperswitch | crates/router/src/core/payments/flows/approve_flow.rs | .rs | use async_trait::async_trait;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
core::{
errors::{ApiErrorResponse, NotImplementedMessage, RouterResult},
payments::{self, access_token, helpers, transformers, PaymentData},
},
routes::SessionState,
services,
types::{self, a... | 874 | 1,614 |
hyperswitch | crates/router/src/core/payments/flows/cancel_flow.rs | .rs | use async_trait::async_trait;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, PaymentData},
},
routes::{metrics, SessionState},
services,
types::{self, api, domain}... | 1,027 | 1,615 |
hyperswitch | crates/router/src/core/payments/flows/authorize_flow.rs | .rs | use async_trait::async_trait;
use common_enums as enums;
use hyperswitch_domain_models::errors::api_error_response::ApiErrorResponse;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::payments::PaymentConfirmData;
use masking::ExposeInterface;
// use router_env::tracing::Instrument;
use super::{ConstructFlowSpecif... | 4,669 | 1,616 |
hyperswitch | crates/router/src/core/payments/flows/session_flow.rs | .rs | use api_models::{admin as admin_types, payments as payment_types};
use async_trait::async_trait;
use common_utils::{
ext_traits::ByteSliceExt,
request::RequestContent,
types::{AmountConvertor, StringMajorUnitForConnector},
};
use error_stack::{Report, ResultExt};
#[cfg(feature = "v2")]
use hyperswitch_domai... | 9,815 | 1,617 |
hyperswitch | crates/router/src/core/payments/flows/post_session_tokens_flow.rs | .rs | use async_trait::async_trait;
use super::ConstructFlowSpecificData;
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, Feature, PaymentData},
},
routes::SessionState,
services,
types::{self, api, domain},
};
#[async... | 1,026 | 1,618 |
hyperswitch | crates/router/src/core/payments/flows/capture_flow.rs | .rs | use async_trait::async_trait;
use super::ConstructFlowSpecificData;
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, Feature, PaymentData},
},
routes::SessionState,
services,
types::{self, api, domain},
};
#[cfg(f... | 1,247 | 1,619 |
hyperswitch | crates/router/src/core/payments/flows/incremental_authorization_flow.rs | .rs | use async_trait::async_trait;
use super::ConstructFlowSpecificData;
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
payments::{self, access_token, helpers, transformers, Feature, PaymentData},
},
routes::SessionState,
services,
types::{self, api, domain},
};
#[async... | 1,027 | 1,620 |
hyperswitch | crates/router/src/core/payments/flows/reject_flow.rs | .rs | use async_trait::async_trait;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
core::{
errors::{ApiErrorResponse, NotImplementedMessage, RouterResult},
payments::{self, access_token, helpers, transformers, PaymentData},
},
routes::SessionState,
services,
types::{self, a... | 861 | 1,621 |
hyperswitch | crates/router/src/core/payments/flows/setup_mandate_flow.rs | .rs | use async_trait::async_trait;
use router_env::logger;
use super::{ConstructFlowSpecificData, Feature};
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
mandate,
payments::{
self, access_token, customers, helpers, tokenization, transformers, PaymentData,
},... | 1,881 | 1,622 |
hyperswitch | crates/router/src/core/payments/operations/payment_create_intent.rs | .rs | use std::marker::PhantomData;
use api_models::{enums::FrmSuggestion, payments::PaymentsCreateIntentRequest};
use async_trait::async_trait;
use common_utils::{
errors::CustomResult,
ext_traits::{AsyncExt, Encode, ValueExt},
types::keymanager::ToEncryptable,
};
use error_stack::ResultExt;
use masking::PeekIn... | 2,269 | 1,623 |
hyperswitch | crates/router/src/core/payments/operations/payment_status.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState};
use error_stack::ResultExt;
use router_derive::PaymentOperation;
use router_env::{instrument, logger, tracing};
use super::{BoxedOperation, Do... | 4,857 | 1,624 |
hyperswitch | crates/router/src/core/payments/operations/tax_calculation.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState};
use error_stack::ResultExt;
use masking::PeekInterface;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use super:... | 3,466 | 1,625 |
hyperswitch | crates/router/src/core/payments/operations/payment_response.rs | .rs | use std::collections::HashMap;
use api_models::payments::{ConnectorMandateReferenceId, MandateReferenceId};
#[cfg(feature = "dynamic_routing")]
use api_models::routing::RoutableConnectorChoice;
use async_trait::async_trait;
use common_enums::{AuthorizationStatus, SessionUpdateStatus};
#[cfg(all(feature = "v1", feature... | 20,348 | 1,626 |
hyperswitch | crates/router/src/core/payments/operations/payment_session.rs | .rs | use std::marker::PhantomData;
use api_models::{admin::PaymentMethodsEnabled, enums::FrmSuggestion};
use async_trait::async_trait;
use common_utils::ext_traits::{AsyncExt, ValueExt};
use error_stack::ResultExt;
use router_derive::PaymentOperation;
use router_env::{instrument, logger, tracing};
use super::{BoxedOperati... | 3,687 | 1,627 |
hyperswitch | crates/router/src/core/payments/operations/payment_post_session_tokens.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::types::keymanager::KeyManagerState;
use error_stack::ResultExt;
use masking::PeekInterface;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain... | 2,205 | 1,628 |
hyperswitch | crates/router/src/core/payments/operations/payment_get_intent.rs | .rs | use std::marker::PhantomData;
use api_models::{enums::FrmSuggestion, payments::PaymentsGetIntentRequest};
use async_trait::async_trait;
use common_utils::errors::CustomResult;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
use crate::... | 1,752 | 1,629 |
hyperswitch | crates/router/src/core/payments/operations/payment_confirm_intent.rs | .rs | use api_models::{enums::FrmSuggestion, payments::PaymentsConfirmIntentRequest};
use async_trait::async_trait;
use common_utils::{ext_traits::Encode, types::keymanager::ToEncryptable};
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::PaymentConfirmData;
use masking::PeekInterface;
use router_env::{in... | 3,655 | 1,630 |
hyperswitch | crates/router/src/core/payments/operations/payment_session_intent.rs | .rs | use std::{collections::HashMap, marker::PhantomData};
use api_models::payments::PaymentsSessionRequest;
use async_trait::async_trait;
use common_utils::{errors::CustomResult, ext_traits::Encode};
use error_stack::ResultExt;
use hyperswitch_domain_models::customer;
use router_env::{instrument, logger, tracing};
use su... | 3,098 | 1,631 |
hyperswitch | crates/router/src/core/payments/operations/payment_capture.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::ext_traits::AsyncExt;
use error_stack::ResultExt;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
use crate::{
core... | 2,412 | 1,632 |
hyperswitch | crates/router/src/core/payments/operations/payment_confirm.rs | .rs | use std::marker::PhantomData;
// use api_models::{admin::ExtendedCardInfoConfig, enums::FrmSuggestion, payments::ExtendedCardInfo};
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use api_models::payment_methods::PaymentMethodsData;
use api_models::{
admin::ExtendedCardInfoConfig,
... | 14,694 | 1,633 |
hyperswitch | crates/router/src/core/payments/operations/payment_complete_authorize.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use error_stack::{report, ResultExt};
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
use crate::{
... | 4,018 | 1,634 |
hyperswitch | crates/router/src/core/payments/operations/payment_create.rs | .rs | use std::marker::PhantomData;
use api_models::{
enums::FrmSuggestion, mandates::RecurringDetails, payment_methods::PaymentMethodsData,
payments::GetAddressFromPaymentMethodData,
};
use async_trait::async_trait;
use common_utils::{
ext_traits::{AsyncExt, Encode, ValueExt},
type_name,
types::{
... | 12,016 | 1,635 |
hyperswitch | crates/router/src/core/payments/operations/payment_start.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use error_stack::ResultExt;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
use crate::{
core::{... | 2,580 | 1,636 |
hyperswitch | crates/router/src/core/payments/operations/payment_cancel.rs | .rs | use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use common_utils::ext_traits::AsyncExt;
use error_stack::ResultExt;
use router_derive;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
us... | 2,172 | 1,637 |
hyperswitch | crates/router/src/core/payments/operations/payment_get.rs | .rs | use api_models::{enums::FrmSuggestion, payments::PaymentsRetrieveRequest};
use async_trait::async_trait;
use common_utils::ext_traits::AsyncExt;
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::PaymentStatusData;
use router_env::{instrument, tracing};
use super::{Domain, GetTracker, Operation, Upda... | 2,403 | 1,638 |
hyperswitch | crates/router/src/core/payments/operations/payment_reject.rs | .rs | use std::marker::PhantomData;
use api_models::{enums::FrmSuggestion, payments::PaymentsCancelRequest};
use async_trait::async_trait;
use error_stack::ResultExt;
use router_derive;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
use cra... | 2,171 | 1,639 |
hyperswitch | crates/router/src/core/payments/operations/payment_approve.rs | .rs | use std::marker::PhantomData;
use api_models::enums::{AttemptStatus, FrmSuggestion, IntentStatus};
use async_trait::async_trait;
use error_stack::ResultExt;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateReq... | 2,256 | 1,640 |
hyperswitch | crates/router/src/core/payments/operations/payment_update_intent.rs | .rs | use std::marker::PhantomData;
use api_models::{
enums::{FrmSuggestion, UpdateActiveAttempt},
payments::PaymentsUpdateIntentRequest,
};
use async_trait::async_trait;
use common_utils::{
errors::CustomResult,
ext_traits::{Encode, ValueExt},
types::keymanager::ToEncryptable,
};
use diesel_models::type... | 3,741 | 1,641 |
hyperswitch | crates/router/src/core/payments/operations/payment_capture_v2.rs | .rs | use api_models::{enums::FrmSuggestion, payments::PaymentsCaptureRequest};
use async_trait::async_trait;
use error_stack::ResultExt;
use hyperswitch_domain_models::payments::PaymentCaptureData;
use router_env::{instrument, tracing};
use super::{Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
use crate::... | 2,576 | 1,642 |
hyperswitch | crates/router/src/core/payments/operations/payment_update.rs | .rs | use std::marker::PhantomData;
use api_models::{
enums::FrmSuggestion, mandates::RecurringDetails, payments::RequestSurchargeDetails,
};
use async_trait::async_trait;
use common_utils::{
ext_traits::{AsyncExt, Encode, ValueExt},
pii::Email,
types::keymanager::KeyManagerState,
};
use error_stack::{report... | 7,948 | 1,643 |
hyperswitch | crates/router/src/core/payments/operations/proxy_payments_intent.rs | .rs | use api_models::payments::ProxyPaymentsRequest;
use async_trait::async_trait;
use common_enums::enums;
use common_utils::types::keymanager::ToEncryptable;
use error_stack::ResultExt;
use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData, payments::PaymentConfirmData,
};
use masking::PeekInterface;... | 3,607 | 1,644 |
hyperswitch | crates/router/src/core/payments/operations/payments_incremental_authorization.rs | .rs | use std::marker::PhantomData;
use api_models::{enums::FrmSuggestion, payments::PaymentsIncrementalAuthorizationRequest};
use async_trait::async_trait;
use common_utils::errors::CustomResult;
use diesel_models::authorization::AuthorizationNew;
use error_stack::{report, ResultExt};
use router_env::{instrument, tracing};... | 2,757 | 1,645 |
hyperswitch | crates/router/src/core/payments/operations/payment_attempt_record.rs | .rs | use std::marker::PhantomData;
use api_models::{enums::FrmSuggestion, payments::PaymentsAttemptRecordRequest};
use async_trait::async_trait;
use common_utils::{
errors::CustomResult,
ext_traits::{AsyncExt, Encode, ValueExt},
types::keymanager::ToEncryptable,
};
use error_stack::ResultExt;
use hyperswitch_do... | 2,492 | 1,646 |
hyperswitch | crates/router/src/core/payments/routing/transformers.rs | .rs | use std::collections::HashMap;
use api_models::{self, routing as routing_types};
use diesel_models::enums as storage_enums;
use euclid::{enums as dsl_enums, frontend::ast as dsl_ast};
use kgraph_utils::types;
use crate::{
configs::settings,
types::transformers::{ForeignFrom, ForeignInto},
};
impl ForeignFrom... | 817 | 1,647 |
hyperswitch | crates/router/src/core/user_role/role.rs | .rs | use std::{cmp, collections::HashSet};
use api_models::user_role::role as role_api;
use common_enums::{EntityType, ParentGroup, PermissionGroup};
use common_utils::generate_id_with_default_len;
use diesel_models::role::{ListRolesByEntityPayload, RoleNew, RoleUpdate};
use error_stack::{report, ResultExt};
use crate::{
... | 3,742 | 1,648 |
hyperswitch | crates/router/src/core/errors/error_handlers.rs | .rs | use actix_web::{body, dev::ServiceResponse, middleware::ErrorHandlerResponse, ResponseError};
use http::StatusCode;
use super::ApiErrorResponse;
use crate::logger;
pub fn custom_error_handlers<B: body::MessageBody + 'static>(
res: ServiceResponse<B>,
) -> actix_web::Result<ErrorHandlerResponse<B>> {
let error_... | 287 | 1,649 |
hyperswitch | crates/router/src/core/errors/user.rs | .rs | use common_utils::errors::CustomResult;
use crate::services::ApplicationResponse;
pub type UserResult<T> = CustomResult<T, UserErrors>;
pub type UserResponse<T> = CustomResult<ApplicationResponse<T>, UserErrors>;
pub mod sample_data;
#[derive(Debug, thiserror::Error)]
pub enum UserErrors {
#[error("User Internal... | 3,500 | 1,650 |
hyperswitch | crates/router/src/core/errors/customers_error_response.rs | .rs | use http::StatusCode;
#[derive(Debug, thiserror::Error)]
pub enum CustomersErrorResponse {
#[error("Customer has already been redacted")]
CustomerRedacted,
#[error("Something went wrong")]
InternalServerError,
#[error("Customer has already been redacted")]
MandateActive,
#[error("Custome... | 208 | 1,651 |
hyperswitch | crates/router/src/core/errors/utils.rs | .rs | use common_utils::errors::CustomResult;
use crate::{core::errors, logger};
pub trait StorageErrorExt<T, E> {
#[track_caller]
fn to_not_found_response(self, not_found_response: E) -> error_stack::Result<T, E>;
#[track_caller]
fn to_duplicate_response(self, duplicate_response: E) -> error_stack::Result... | 4,919 | 1,652 |
hyperswitch | crates/router/src/core/errors/transformers.rs | .rs | use common_utils::errors::ErrorSwitch;
use hyperswitch_domain_models::errors::api_error_response::ApiErrorResponse;
use super::{CustomersErrorResponse, StorageError};
impl ErrorSwitch<api_models::errors::types::ApiErrorResponse> for CustomersErrorResponse {
fn switch(&self) -> api_models::errors::types::ApiErrorR... | 481 | 1,653 |
hyperswitch | crates/router/src/core/errors/user/sample_data.rs | .rs | use api_models::errors::types::{ApiError, ApiErrorResponse};
use common_utils::errors::{CustomResult, ErrorSwitch, ErrorSwitchFrom};
use storage_impl::errors::StorageError;
pub type SampleDataResult<T> = CustomResult<T, SampleDataError>;
#[derive(Debug, Clone, serde::Serialize, thiserror::Error)]
pub enum SampleDataE... | 373 | 1,654 |
hyperswitch | crates/router/src/core/mandate/helpers.rs | .rs | use api_models::payments as api_payments;
use common_enums::enums;
use common_utils::errors::CustomResult;
use diesel_models::Mandate;
use error_stack::ResultExt;
use hyperswitch_domain_models::mandates::MandateData;
use crate::{
core::{errors, payments},
routes::SessionState,
types::{api, domain},
};
#[c... | 823 | 1,655 |
hyperswitch | crates/router/src/core/mandate/utils.rs | .rs | use std::marker::PhantomData;
use common_utils::{errors::CustomResult, ext_traits::ValueExt};
use diesel_models::Mandate;
use error_stack::ResultExt;
use crate::{
core::{errors, payments::helpers},
types::{self, domain, PaymentAddress},
SessionState,
};
const IRRELEVANT_ATTEMPT_ID_IN_MANDATE_REVOKE_FLOW:... | 757 | 1,656 |
hyperswitch | crates/router/src/core/unified_authentication_service/utils.rs | .rs | use std::marker::PhantomData;
use common_enums::enums::PaymentMethod;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use hyperswitch_domain_models::{
errors::api_error_response::ApiErrorResponse,
payment_address::PaymentAddress,
router_data::{ConnectorAuthType, ErrorResponse, RouterDat... | 2,152 | 1,657 |
hyperswitch | crates/router/src/core/unified_authentication_service/types.rs | .rs | use api_models::payments;
use hyperswitch_domain_models::{
errors::api_error_response::{self as errors, NotImplementedMessage},
router_request_types::{
authentication::MessageCategory,
unified_authentication_service::{
UasAuthenticationRequestData, UasPostAuthenticationRequestData,
... | 1,346 | 1,658 |
hyperswitch | crates/router/src/core/relay/utils.rs | .rs | use std::str::FromStr;
use common_utils::{ext_traits::OptionExt, id_type};
use error_stack::ResultExt;
use hyperswitch_domain_models::{router_data::ErrorResponse, types};
use crate::{
core::payments,
db::{
domain,
errors::{self, RouterResult},
},
routes::SessionState,
};
const IRRELEV... | 1,190 | 1,659 |
hyperswitch | crates/router/src/core/connector_onboarding/paypal.rs | .rs | use api_models::{admin::MerchantConnectorUpdate, connector_onboarding as api};
use common_utils::ext_traits::Encode;
use error_stack::ResultExt;
use masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
core::{
admin,
errors::{ApiErrorResponse, RouterResult},
},
services::{send_re... | 1,440 | 1,660 |
hyperswitch | crates/router/src/core/fraud_check/operation.rs | .rs | pub mod fraud_check_post;
pub mod fraud_check_pre;
use async_trait::async_trait;
use common_enums::FrmSuggestion;
use error_stack::{report, ResultExt};
pub use self::{fraud_check_post::FraudCheckPost, fraud_check_pre::FraudCheckPre};
use super::{
types::{ConnectorDetailsCore, FrmConfigsObject, PaymentToFrmData},
... | 920 | 1,661 |
hyperswitch | crates/router/src/core/fraud_check/flows.rs | .rs | pub mod checkout_flow;
pub mod fulfillment_flow;
pub mod record_return;
pub mod sale_flow;
pub mod transaction_flow;
use async_trait::async_trait;
use crate::{
core::{
errors::RouterResult,
payments::{self, flows::ConstructFlowSpecificData},
},
routes::SessionState,
services,
types... | 199 | 1,662 |
hyperswitch | crates/router/src/core/fraud_check/types.rs | .rs | use api_models::{
enums as api_enums,
enums::{PaymentMethod, PaymentMethodType},
payments::Amount,
refunds::RefundResponse,
};
use common_enums::FrmSuggestion;
use common_utils::pii::SecretSerdeValue;
use hyperswitch_domain_models::payments::{payment_attempt::PaymentAttempt, PaymentIntent};
pub use hype... | 1,141 | 1,663 |
hyperswitch | crates/router/src/core/fraud_check/flows/fulfillment_flow.rs | .rs | use common_utils::ext_traits::{OptionExt, ValueExt};
use error_stack::ResultExt;
use router_env::tracing::{self, instrument};
use crate::{
core::{
errors::RouterResult, fraud_check::frm_core_types::FrmFulfillmentRequest,
payments::helpers, utils as core_utils,
},
errors,
types::{
... | 1,019 | 1,664 |
hyperswitch | crates/router/src/core/fraud_check/flows/transaction_flow.rs | .rs | use async_trait::async_trait;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
fraud_check::{FeatureFrm, FrmData},
payments::{self, flows::ConstructFlowSpecificData, helpers},
},
errors, services,
... | 1,565 | 1,665 |
hyperswitch | crates/router/src/core/fraud_check/flows/checkout_flow.rs | .rs | use async_trait::async_trait;
use common_utils::{ext_traits::ValueExt, pii::Email};
use error_stack::ResultExt;
use masking::ExposeInterface;
use super::{ConstructFlowSpecificData, FeatureFrm};
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
fraud_check::types::FrmData,
paym... | 1,690 | 1,666 |
hyperswitch | crates/router/src/core/fraud_check/flows/record_return.rs | .rs | use async_trait::async_trait;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use crate::{
connector::signifyd::transformers::RefundMethod,
core::{
errors::{ConnectorErrorExt, RouterResult},
fraud_check::{FeatureFrm, FraudCheckConnectorData, FrmData},
payments::{self... | 1,510 | 1,667 |
hyperswitch | crates/router/src/core/fraud_check/flows/sale_flow.rs | .rs | use async_trait::async_trait;
use common_utils::{ext_traits::ValueExt, pii::Email};
use error_stack::ResultExt;
use masking::ExposeInterface;
use crate::{
core::{
errors::{ConnectorErrorExt, RouterResult},
fraud_check::{FeatureFrm, FraudCheckConnectorData, FrmData},
payments::{self, flows::... | 1,552 | 1,668 |
hyperswitch | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs | .rs | use async_trait::async_trait;
use common_enums::FrmSuggestion;
use common_utils::ext_traits::Encode;
use diesel_models::enums::FraudCheckLastStep;
use router_env::{instrument, tracing};
use uuid::Uuid;
use super::{Domain, FraudCheckOperation, GetTracker, UpdateTracker};
use crate::{
core::{
errors::RouterR... | 2,985 | 1,669 |
hyperswitch | crates/router/src/core/fraud_check/operation/fraud_check_post.rs | .rs | use async_trait::async_trait;
use common_enums::{CaptureMethod, FrmSuggestion};
use common_utils::ext_traits::Encode;
use hyperswitch_domain_models::payments::{
payment_attempt::PaymentAttemptUpdate, payment_intent::PaymentIntentUpdate, HeaderPayload,
};
use router_env::{instrument, logger, tracing};
use super::{D... | 4,806 | 1,670 |
hyperswitch | crates/router/src/core/files/helpers.rs | .rs | use actix_multipart::Field;
use common_utils::errors::CustomResult;
use error_stack::ResultExt;
use futures::TryStreamExt;
use hyperswitch_domain_models::router_response_types::disputes::FileInfo;
use crate::{
core::{
errors::{self, StorageErrorExt},
payments, utils,
},
routes::SessionState... | 2,697 | 1,671 |
hyperswitch | crates/router/src/core/disputes/transformers.rs | .rs | use api_models::disputes::EvidenceType;
use common_utils::errors::CustomResult;
use error_stack::ResultExt;
use crate::{
core::{errors, files::helpers::retrieve_file_and_provider_file_id_from_file_id},
routes::SessionState,
types::{
api::{self, DisputeEvidence},
domain,
transformers... | 2,959 | 1,672 |
hyperswitch | crates/router/src/core/generic_link/expired_link/index.html | .html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ title }}</title>
</head>
<body>
<div class="message">{{ message }}</div>
</body>
</html>
| 78 | 1,673 |
hyperswitch | crates/router/src/core/generic_link/payout_link/status/script.js | .js | // @ts-check
/**
* Trigger - init
* Uses
* - Update document's icon
*/
function boot() {
// @ts-ignore
var payoutDetails = window.__PAYOUT_DETAILS;
// Attach document icon
if (typeof payoutDetails.logo === "string") {
var link = document.createElement("link");
link.rel = "icon";
link.href = pa... | 1,362 | 1,674 |
hyperswitch | crates/router/src/core/generic_link/payout_link/status/index.html | .html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ i18n_payout_link_status_title }}</title>
{{ css_style_tag }}
</head>
<body class="hide-scrollbar">
<div class="main">
<div id="status-card">... | 134 | 1,675 |
hyperswitch | crates/router/src/core/generic_link/payout_link/status/styles.css | .css | html,
body {
height: 100%;
overflow: hidden;
}
body {
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
margin: 0;
color: #333333;
}
/* H... | 788 | 1,676 |
hyperswitch | crates/router/src/core/generic_link/payout_link/initiate/script.js | .js | // @ts-check
// Top level checks
// @ts-ignore
var payoutDetails = window.__PAYOUT_DETAILS;
var isTestMode = payoutDetails.test_mode;
var isFramed = false;
try {
isFramed = window.parent.location !== window.location;
// If parent's window object is restricted, DOMException is
// thrown which concludes that the... | 1,232 | 1,677 |
hyperswitch | crates/router/src/core/generic_link/payout_link/initiate/index.html | .html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ i18n_payout_link_title }}</title>
</head>
{{ css_style_tag }}
<body class="hide-scrollbar">
<div class="main">
<div id="payout-link" class="hi... | 124 | 1,678 |
hyperswitch | crates/router/src/core/generic_link/payout_link/initiate/styles.css | .css | html,
body {
height: 100%;
overflow: hidden;
}
body {
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
display: flex;
flex-flow: column;
align-items: center;
justify-content: flex-start;
margin: 0;
color: #333333;
}
... | 248 | 1,679 |
hyperswitch | crates/router/src/core/generic_link/payment_method_collect/status/script.js | .js | 0 | 1,680 | |
hyperswitch | crates/router/src/core/generic_link/payment_method_collect/status/index.html | .html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Collected!</title>
{{ css_style_tag }}
</head>
<body>
<div class="main"></div>
{{ js_script_tag }}
</body>
</html>
| 89 | 1,681 |
hyperswitch | crates/router/src/core/generic_link/payment_method_collect/status/styles.css | .css | html,
body {
height: 100%;
overflow: hidden;
}
body {
display: flex;
flex-flow: column;
align-items: center;
justify-content: flex-start;
margin: 0;
color: #333333;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.hide-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Ed... | 216 | 1,682 |
hyperswitch | crates/router/src/core/generic_link/payment_method_collect/initiate/script.js | .js | // @ts-check
var widgets = null;
var paymentMethodCollect = null;
// @ts-ignore
var publishableKey = window.__PM_COLLECT_DETAILS.publishable_key;
var hyper = null;
/**
* Trigger - init
* Uses
* - Instantiate SDK
*/
function boot() {
// @ts-ignore
var paymentMethodCollectDetails = window.__PM_COLLECT_DETAILS;... | 553 | 1,683 |
hyperswitch | crates/router/src/core/generic_link/payment_method_collect/initiate/index.html | .html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Payment Method Collect</title>
</head>
{{ css_style_tag }}
<body>
<div class="main">
<div id="payment-method-collect"></div>
</div>
{{ js... | 111 | 1,684 |
hyperswitch | crates/router/src/core/generic_link/payment_method_collect/initiate/styles.css | .css | html,
body {
height: 100%;
overflow: hidden;
}
body {
display: flex;
flex-flow: column;
align-items: center;
justify-content: flex-start;
margin: 0;
color: #333333;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.hide-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Ed... | 213 | 1,685 |
hyperswitch | crates/router/src/core/pm_auth/helpers.rs | .rs | use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use pm_auth::types::{self as pm_auth_types, api::BoxedPaymentAuthConnector};
use crate::{
core::errors::{self, ApiErrorResponse},
types::{self, domain, transformers::ForeignTryFrom},
};
pub trait PaymentAuthConnectorDataExt {
fn get_conne... | 268 | 1,686 |
hyperswitch | crates/router/src/core/pm_auth/transformers.rs | .rs | use pm_auth::types as pm_auth_types;
use crate::{core::errors, types, types::transformers::ForeignTryFrom};
impl From<types::MerchantAccountData> for pm_auth_types::MerchantAccountData {
fn from(from: types::MerchantAccountData) -> Self {
match from {
types::MerchantAccountData::Iban { iban, n... | 375 | 1,687 |
hyperswitch | crates/router/src/core/routing/helpers.rs | .rs | //! Analysis for usage of all helper functions for use case of routing
//!
//! Functions that are used to perform the retrieval of merchant's
//! routing dict, configs, defaults
use std::fmt::Debug;
#[cfg(all(feature = "dynamic_routing", feature = "v1"))]
use std::str::FromStr;
#[cfg(all(feature = "dynamic_routing", fe... | 12,298 | 1,688 |
hyperswitch | crates/router/src/core/routing/transformers.rs | .rs | use api_models::routing::{
MerchantRoutingAlgorithm, RoutingAlgorithm as Algorithm, RoutingAlgorithmKind,
RoutingDictionaryRecord,
};
use common_utils::ext_traits::ValueExt;
use diesel_models::{
enums as storage_enums,
routing_algorithm::{RoutingAlgorithm, RoutingProfileMetadata},
};
use crate::{
c... | 743 | 1,689 |
hyperswitch | crates/router/src/core/verification/utils.rs | .rs | use common_utils::{errors::CustomResult, id_type::PaymentId};
use error_stack::{Report, ResultExt};
use crate::{
core::{
errors::{self, utils::StorageErrorExt},
utils,
},
logger,
routes::SessionState,
services::authentication::AuthenticationData,
types::{self, storage},
};
pub ... | 1,174 | 1,690 |
hyperswitch | crates/router/src/core/card_testing_guard/utils.rs | .rs | use error_stack::ResultExt;
use hyperswitch_domain_models::{
card_testing_guard_data::CardTestingGuardData, router_request_types::BrowserInformation,
};
use masking::{PeekInterface, Secret};
use router_env::logger;
use super::errors;
use crate::{
core::{errors::RouterResult, payments::helpers},
routes::Ses... | 1,328 | 1,691 |
hyperswitch | crates/router/src/core/payouts/validator.rs | .rs | use std::collections::HashSet;
use actix_web::http::header;
#[cfg(feature = "olap")]
use common_utils::errors::CustomResult;
use common_utils::validation::validate_domain_against_allowed_domains;
use diesel_models::generic_link::PayoutLink;
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::payment_m... | 3,120 | 1,692 |
hyperswitch | crates/router/src/core/payouts/access_token.rs | .rs | use common_utils::ext_traits::AsyncExt;
use error_stack::ResultExt;
use crate::{
consts,
core::{
errors::{self, RouterResult},
payments,
},
routes::{metrics, SessionState},
services,
types::{self, api as api_types, domain, storage::enums},
};
/// After we get the access token, ... | 1,330 | 1,693 |
hyperswitch | crates/router/src/core/payouts/retry.rs | .rs | use std::{cmp::Ordering, str::FromStr, vec::IntoIter};
use common_enums::PayoutRetryType;
use error_stack::{report, ResultExt};
use router_env::{
logger,
tracing::{self, instrument},
};
use super::{call_connector_payout, PayoutData};
use crate::{
core::{
errors::{self, RouterResult, StorageErrorEx... | 2,657 | 1,694 |
hyperswitch | crates/router/src/core/payouts/helpers.rs | .rs | use api_models::{enums, payment_methods::Card, payouts};
use common_utils::{
crypto::Encryptable,
encryption::Encryption,
errors::CustomResult,
ext_traits::{AsyncExt, StringExt},
fp_utils, id_type, payout_method_utils as payout_additional, pii, type_name,
types::{
keymanager::{Identifier... | 10,993 | 1,695 |
hyperswitch | crates/router/src/core/payouts/transformers.rs | .rs | use std::collections::HashMap;
use common_utils::link_utils::EnabledPaymentMethod;
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "customer_v2"),
feature = "olap"
))]
use crate::types::transformers::ForeignInto;
#[cfg(feature = "olap")]
use crate::types::{api::payments, domain, storage};
us... | 1,293 | 1,696 |
hyperswitch | crates/router/src/core/authentication/utils.rs | .rs | use error_stack::ResultExt;
use hyperswitch_domain_models::router_data_v2::ExternalAuthenticationFlowData;
use crate::{
consts,
core::{
errors::{self, ConnectorErrorExt, StorageErrorExt},
payments,
},
errors::RouterResult,
routes::SessionState,
services::{self, execute_connector... | 2,281 | 1,697 |
hyperswitch | crates/router/src/core/authentication/transformers.rs | .rs | use std::marker::PhantomData;
use api_models::payments;
use common_enums::PaymentMethod;
use common_utils::ext_traits::ValueExt;
use error_stack::ResultExt;
use crate::{
core::{
errors::{self, RouterResult},
payments::helpers as payments_helpers,
},
types::{
self, domain, storage,
... | 1,766 | 1,698 |
hyperswitch | crates/router/src/core/authentication/types.rs | .rs | use error_stack::{Report, ResultExt};
pub use hyperswitch_domain_models::router_request_types::authentication::{
AcquirerDetails, ExternalThreeDSConnectorMetadata, PreAuthenticationData, ThreeDsMethodData,
};
use crate::{
core::errors,
types::{storage, transformers::ForeignTryFrom},
utils::OptionExt,
}... | 288 | 1,699 |
hyperswitch | crates/router/src/core/payment_methods/validator.rs | .rs | use api_models::{admin, payment_methods::PaymentMethodCollectLinkRequest};
use common_utils::link_utils;
use diesel_models::generic_link::PaymentMethodCollectLinkData;
use error_stack::ResultExt;
use masking::Secret;
use crate::{
consts,
core::{
errors::{self, RouterResult},
utils as core_utils... | 1,171 | 1,700 |
hyperswitch | crates/router/src/core/payment_methods/network_tokenization.rs | .rs | #[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use std::fmt::Debug;
use api_models::payment_methods as api_payment_methods;
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use cards::{CardNumber, NetworkToken};
use common_utils::{
errors::CustomResult,
ext_traits::{BytesExt, Encode},
... | 6,798 | 1,701 |
hyperswitch | crates/router/src/core/payment_methods/utils.rs | .rs | use std::{str::FromStr, sync::Arc};
use api_models::{
admin::{self, PaymentMethodsEnabled},
enums as api_enums,
payment_methods::RequestPaymentMethodTypes,
};
use common_enums::enums;
use euclid::frontend::dir;
use hyperswitch_constraint_graph as cgraph;
use kgraph_utils::{error::KgraphError, transformers:... | 5,580 | 1,702 |
hyperswitch | crates/router/src/core/payment_methods/cards.rs | .rs | use std::{
collections::{HashMap, HashSet},
fmt::Debug,
str::FromStr,
};
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
use api_models::admin::PaymentMethodsEnabled;
use api_models::{
enums as api_enums,
payment_methods::{
BankAccountTokenDat... | 46,387 | 1,703 |
hyperswitch | crates/router/src/core/payment_methods/tokenize.rs | .rs | use actix_multipart::form::{bytes::Bytes, text::Text, MultipartForm};
use api_models::{enums as api_enums, payment_methods as payment_methods_api};
use cards::CardNumber;
use common_utils::{
crypto::Encryptable,
id_type,
transformers::{ForeignFrom, ForeignTryFrom},
};
use error_stack::{report, ResultExt};
u... | 3,236 | 1,704 |
hyperswitch | crates/router/src/core/payment_methods/transformers.rs | .rs | use api_models::{enums as api_enums, payment_methods::Card};
use common_utils::{
ext_traits::{Encode, StringExt},
id_type,
pii::Email,
request::RequestContent,
};
use error_stack::ResultExt;
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use hyperswitch_domain_models::payment_method_data;
u... | 9,062 | 1,705 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.