text
stringlengths 65
57.3k
| file_path
stringlengths 22
92
| module
stringclasses 38
values | type
stringclasses 7
values | struct_name
stringlengths 3
60
⌀ | impl_count
int64 0
60
⌀ | traits
listlengths 0
59
⌀ | tokens
int64 16
8.19k
| function_name
stringlengths 3
85
⌀ | type_name
stringlengths 1
67
⌀ | trait_name
stringclasses 573
values | method_count
int64 0
31
⌀ | public_method_count
int64 0
19
⌀ | submodule_count
int64 0
56
⌀ | export_count
int64 0
9
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
// Function: update_capture
// File: crates/router/src/core/payments/types.rs
// Module: router
pub fn update_capture(&mut self, updated_capture: storage::Capture)
|
crates/router/src/core/payments/types.rs
|
router
|
function_signature
| null | null | null | 38
|
update_capture
| null | null | null | null | null | null |
// Struct: HelcimLineItems
// File: crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct HelcimLineItems
|
crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
HelcimLineItems
| 0
|
[] | 53
| null | null | null | null | null | null | null |
// File: crates/router/src/core/profile_acquirer.rs
// Module: router
// Public functions: 2
use api_models::profile_acquirer;
use common_utils::types::keymanager::KeyManagerState;
use error_stack::ResultExt;
use crate::{
core::errors::{self, utils::StorageErrorExt, RouterResponse},
services::api,
types::domain,
SessionState,
};
#[cfg(all(feature = "olap", feature = "v1"))]
pub async fn create_profile_acquirer(
state: SessionState,
request: profile_acquirer::ProfileAcquirerCreate,
merchant_context: domain::MerchantContext,
) -> RouterResponse<profile_acquirer::ProfileAcquirerResponse> {
let db = state.store.as_ref();
let profile_acquirer_id = common_utils::generate_profile_acquirer_id_of_default_length();
let key_manager_state: KeyManagerState = (&state).into();
let merchant_key_store = merchant_context.get_merchant_key_store();
let mut business_profile = db
.find_business_profile_by_profile_id(
&key_manager_state,
merchant_key_store,
&request.profile_id,
)
.await
.to_not_found_response(errors::ApiErrorResponse::ProfileNotFound {
id: request.profile_id.get_string_repr().to_owned(),
})?;
let incoming_acquirer_config = common_types::domain::AcquirerConfig {
acquirer_assigned_merchant_id: request.acquirer_assigned_merchant_id.clone(),
merchant_name: request.merchant_name.clone(),
network: request.network.clone(),
acquirer_bin: request.acquirer_bin.clone(),
acquirer_ica: request.acquirer_ica.clone(),
acquirer_fraud_rate: request.acquirer_fraud_rate,
};
// Check for duplicates before proceeding
business_profile
.acquirer_config_map
.as_ref()
.map_or(Ok(()), |configs_wrapper| {
match configs_wrapper.0.values().any(|existing_config| existing_config == &incoming_acquirer_config) {
true => Err(error_stack::report!(
errors::ApiErrorResponse::GenericDuplicateError {
message: format!(
"Duplicate acquirer configuration found for profile_id: {}. Conflicting configuration: {:?}",
request.profile_id.get_string_repr(),
incoming_acquirer_config
),
}
)),
false => Ok(()),
}
})?;
// Get a mutable reference to the HashMap inside AcquirerConfigMap,
// initializing if it's None or the inner HashMap is not present.
let configs_map = &mut business_profile
.acquirer_config_map
.get_or_insert_with(|| {
common_types::domain::AcquirerConfigMap(std::collections::HashMap::new())
})
.0;
configs_map.insert(
profile_acquirer_id.clone(),
incoming_acquirer_config.clone(),
);
let profile_update = domain::ProfileUpdate::AcquirerConfigMapUpdate {
acquirer_config_map: business_profile.acquirer_config_map.clone(),
};
let updated_business_profile = db
.update_profile_by_profile_id(
&key_manager_state,
merchant_key_store,
business_profile,
profile_update,
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to update business profile with new acquirer config")?;
let updated_acquire_details = updated_business_profile
.acquirer_config_map
.as_ref()
.and_then(|acquirer_configs_wrapper| acquirer_configs_wrapper.0.get(&profile_acquirer_id))
.ok_or(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to get updated acquirer config")?;
let response = profile_acquirer::ProfileAcquirerResponse::from((
profile_acquirer_id,
&request.profile_id,
updated_acquire_details,
));
Ok(api::ApplicationResponse::Json(response))
}
#[cfg(all(feature = "olap", feature = "v1"))]
pub async fn update_profile_acquirer_config(
state: SessionState,
profile_id: common_utils::id_type::ProfileId,
profile_acquirer_id: common_utils::id_type::ProfileAcquirerId,
request: profile_acquirer::ProfileAcquirerUpdate,
merchant_context: domain::MerchantContext,
) -> RouterResponse<profile_acquirer::ProfileAcquirerResponse> {
let db = state.store.as_ref();
let key_manager_state = (&state).into();
let merchant_key_store = merchant_context.get_merchant_key_store();
let mut business_profile = db
.find_business_profile_by_profile_id(&key_manager_state, merchant_key_store, &profile_id)
.await
.to_not_found_response(errors::ApiErrorResponse::ProfileNotFound {
id: profile_id.get_string_repr().to_owned(),
})?;
let acquirer_config_map = business_profile
.acquirer_config_map
.as_mut()
.ok_or(errors::ApiErrorResponse::ProfileAcquirerNotFound {
profile_id: profile_id.get_string_repr().to_owned(),
profile_acquirer_id: profile_acquirer_id.get_string_repr().to_owned(),
})
.attach_printable("no acquirer config found in business profile")?;
let mut potential_updated_config = acquirer_config_map
.0
.get(&profile_acquirer_id)
.ok_or_else(|| errors::ApiErrorResponse::ProfileAcquirerNotFound {
profile_id: profile_id.get_string_repr().to_owned(),
profile_acquirer_id: profile_acquirer_id.get_string_repr().to_owned(),
})?
.clone();
// updating value in existing acquirer config
request
.acquirer_assigned_merchant_id
.map(|val| potential_updated_config.acquirer_assigned_merchant_id = val);
request
.merchant_name
.map(|val| potential_updated_config.merchant_name = val);
request
.network
.map(|val| potential_updated_config.network = val);
request
.acquirer_bin
.map(|val| potential_updated_config.acquirer_bin = val);
request
.acquirer_ica
.map(|val| potential_updated_config.acquirer_ica = Some(val.clone()));
request
.acquirer_fraud_rate
.map(|val| potential_updated_config.acquirer_fraud_rate = val);
// checking for duplicates in the acquirerConfigMap
match acquirer_config_map
.0
.iter()
.find(|(_existing_id, existing_config_val_ref)| {
**existing_config_val_ref == potential_updated_config
}) {
Some((conflicting_id_of_found_item, _)) => {
Err(error_stack::report!(errors::ApiErrorResponse::GenericDuplicateError {
message: format!(
"Duplicate acquirer configuration. This configuration already exists for profile_acquirer_id '{}' under profile_id '{}'.",
conflicting_id_of_found_item.get_string_repr(),
profile_id.get_string_repr()
),
}))
}
None => Ok(()),
}?;
acquirer_config_map
.0
.insert(profile_acquirer_id.clone(), potential_updated_config);
let updated_map_for_db_update = business_profile.acquirer_config_map.clone();
let profile_update = domain::ProfileUpdate::AcquirerConfigMapUpdate {
acquirer_config_map: updated_map_for_db_update,
};
let updated_business_profile = db
.update_profile_by_profile_id(
&key_manager_state,
merchant_key_store,
business_profile,
profile_update,
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to update business profile with updated acquirer config")?;
let final_acquirer_details = updated_business_profile
.acquirer_config_map
.as_ref()
.and_then(|configs_wrapper| configs_wrapper.0.get(&profile_acquirer_id))
.ok_or(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to get updated acquirer config after DB update")?;
let response = profile_acquirer::ProfileAcquirerResponse::from((
profile_acquirer_id,
&profile_id,
final_acquirer_details,
));
Ok(api::ApplicationResponse::Json(response))
}
|
crates/router/src/core/profile_acquirer.rs
|
router
|
full_file
| null | null | null | 1,739
| null | null | null | null | null | null | null |
// Struct: PlaidPaymentInitiation
// File: crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PlaidPaymentInitiation
|
crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PlaidPaymentInitiation
| 0
|
[] | 51
| null | null | null | null | null | null | null |
// Trait: AuthenticateAndFetch
// File: crates/router/src/services/authentication.rs
// Module: router
pub trait AuthenticateAndFetch<T, A>
|
crates/router/src/services/authentication.rs
|
router
|
trait_definition
| null | null | null | 31
| null | null |
AuthenticateAndFetch
| null | null | null | null |
// Struct: CeleroSearchRequest
// File: crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct CeleroSearchRequest
|
crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
CeleroSearchRequest
| 0
|
[] | 50
| null | null | null | null | null | null | null |
// Function: contains_token
// File: crates/router/src/core/proxy/utils.rs
// Module: router
pub fn contains_token(s: &str) -> bool
|
crates/router/src/core/proxy/utils.rs
|
router
|
function_signature
| null | null | null | 34
|
contains_token
| null | null | null | null | null | null |
// File: crates/analytics/src/auth_events/accumulator.rs
// Module: analytics
// Public functions: 1
// Public structs: 3
use api_models::analytics::auth_events::AuthEventMetricsBucketValue;
use super::metrics::AuthEventMetricRow;
#[derive(Debug, Default)]
pub struct AuthEventMetricsAccumulator {
pub authentication_count: CountAccumulator,
pub authentication_attempt_count: CountAccumulator,
pub authentication_error_message: AuthenticationErrorMessageAccumulator,
pub authentication_success_count: CountAccumulator,
pub challenge_flow_count: CountAccumulator,
pub challenge_attempt_count: CountAccumulator,
pub challenge_success_count: CountAccumulator,
pub frictionless_flow_count: CountAccumulator,
pub frictionless_success_count: CountAccumulator,
pub authentication_funnel: CountAccumulator,
pub authentication_exemption_approved_count: CountAccumulator,
pub authentication_exemption_requested_count: CountAccumulator,
}
#[derive(Debug, Default)]
#[repr(transparent)]
pub struct CountAccumulator {
pub count: Option<i64>,
}
#[derive(Debug, Default)]
pub struct AuthenticationErrorMessageAccumulator {
pub count: Option<i64>,
}
pub trait AuthEventMetricAccumulator {
type MetricOutput;
fn add_metrics_bucket(&mut self, metrics: &AuthEventMetricRow);
fn collect(self) -> Self::MetricOutput;
}
impl AuthEventMetricAccumulator for CountAccumulator {
type MetricOutput = Option<u64>;
#[inline]
fn add_metrics_bucket(&mut self, metrics: &AuthEventMetricRow) {
self.count = match (self.count, metrics.count) {
(None, None) => None,
(None, i @ Some(_)) | (i @ Some(_), None) => i,
(Some(a), Some(b)) => Some(a + b),
}
}
#[inline]
fn collect(self) -> Self::MetricOutput {
self.count.and_then(|i| u64::try_from(i).ok())
}
}
impl AuthEventMetricAccumulator for AuthenticationErrorMessageAccumulator {
type MetricOutput = Option<u64>;
#[inline]
fn add_metrics_bucket(&mut self, metrics: &AuthEventMetricRow) {
self.count = match (self.count, metrics.count) {
(None, None) => None,
(None, i @ Some(_)) | (i @ Some(_), None) => i,
(Some(a), Some(b)) => Some(a + b),
}
}
#[inline]
fn collect(self) -> Self::MetricOutput {
self.count.and_then(|i| u64::try_from(i).ok())
}
}
impl AuthEventMetricsAccumulator {
pub fn collect(self) -> AuthEventMetricsBucketValue {
AuthEventMetricsBucketValue {
authentication_count: self.authentication_count.collect(),
authentication_attempt_count: self.authentication_attempt_count.collect(),
authentication_success_count: self.authentication_success_count.collect(),
challenge_flow_count: self.challenge_flow_count.collect(),
challenge_attempt_count: self.challenge_attempt_count.collect(),
challenge_success_count: self.challenge_success_count.collect(),
frictionless_flow_count: self.frictionless_flow_count.collect(),
frictionless_success_count: self.frictionless_success_count.collect(),
error_message_count: self.authentication_error_message.collect(),
authentication_funnel: self.authentication_funnel.collect(),
authentication_exemption_approved_count: self
.authentication_exemption_approved_count
.collect(),
authentication_exemption_requested_count: self
.authentication_exemption_requested_count
.collect(),
}
}
}
|
crates/analytics/src/auth_events/accumulator.rs
|
analytics
|
full_file
| null | null | null | 783
| null | null | null | null | null | null | null |
// File: crates/hyperswitch_connectors/src/connectors/tsys.rs
// Module: hyperswitch_connectors
// Public functions: 1
// Public structs: 1
pub mod transformers;
use std::sync::LazyLock;
use common_enums::enums;
use common_utils::{
errors::CustomResult,
ext_traits::BytesExt,
request::{Method, Request, RequestBuilder, RequestContent},
types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector},
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
router_data::{AccessToken, ErrorResponse, RouterData},
router_flow_types::{
access_token_auth::AccessTokenAuth,
payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void},
refunds::{Execute, RSync},
},
router_request_types::{
AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
RefundsData, SetupMandateRequestData,
},
router_response_types::{
ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
SupportedPaymentMethods, SupportedPaymentMethodsExt,
},
types::{
PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,
},
};
use hyperswitch_interfaces::{
api::{
self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorSpecifications,
ConnectorValidation,
},
configs::Connectors,
errors,
events::connector_api_logs::ConnectorEvent,
types::{
PaymentsAuthorizeType, PaymentsCaptureType, PaymentsSyncType, PaymentsVoidType,
RefundExecuteType, RefundSyncType, Response,
},
webhooks,
};
use transformers as tsys;
use crate::{constants::headers, types::ResponseRouterData, utils};
#[derive(Clone)]
pub struct Tsys {
amount_converter: &'static (dyn AmountConvertor<Output = StringMinorUnit> + Sync),
}
impl Tsys {
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
}
impl api::Payment for Tsys {}
impl api::PaymentSession for Tsys {}
impl api::ConnectorAccessToken for Tsys {}
impl api::MandateSetup for Tsys {}
impl api::PaymentAuthorize for Tsys {}
impl api::PaymentSync for Tsys {}
impl api::PaymentCapture for Tsys {}
impl api::PaymentVoid for Tsys {}
impl api::Refund for Tsys {}
impl api::RefundExecute for Tsys {}
impl api::RefundSync for Tsys {}
impl api::PaymentToken for Tsys {}
impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
for Tsys
{
}
impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Tsys
where
Self: ConnectorIntegration<Flow, Request, Response>,
{
fn build_headers(
&self,
_req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
let header = vec![(
headers::CONTENT_TYPE.to_string(),
Self::get_content_type(self).to_string().into(),
)];
Ok(header)
}
}
impl ConnectorCommon for Tsys {
fn id(&self) -> &'static str {
"tsys"
}
fn common_get_content_type(&self) -> &'static str {
"application/json"
}
fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {
connectors.tsys.base_url.as_ref()
}
}
impl ConnectorValidation for Tsys {}
impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Tsys {}
impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Tsys {}
impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Tsys {
fn build_request(
&self,
_req: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,
_connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Err(
errors::ConnectorError::NotImplemented("Setup Mandate flow for Tsys".to_string())
.into(),
)
}
}
impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Tsys {
fn get_headers(
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}
fn get_url(
&self,
_req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}servlets/transnox_api_server",
self.base_url(connectors)
))
}
fn get_request_body(
&self,
req: &PaymentsAuthorizeRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let amount = utils::convert_amount(
self.amount_converter,
req.request.minor_amount,
req.request.currency,
)?;
let connector_router_data = tsys::TsysRouterData::from((amount, req));
let connector_req: transformers::TsysPaymentsRequest =
tsys::TsysPaymentsRequest::try_from(&connector_router_data)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
fn build_request(
&self,
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Post)
.url(&PaymentsAuthorizeType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(PaymentsAuthorizeType::get_headers(self, req, connectors)?)
.set_body(PaymentsAuthorizeType::get_request_body(
self, req, connectors,
)?)
.build(),
))
}
fn handle_response(
&self,
data: &PaymentsAuthorizeRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {
let response: tsys::TsysPaymentsResponse = res
.response
.parse_struct("Tsys PaymentsAuthorizeResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}
impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tsys {
fn get_headers(
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}
fn get_url(
&self,
_req: &PaymentsSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}servlets/transnox_api_server",
self.base_url(connectors)
))
}
fn get_request_body(
&self,
req: &PaymentsSyncRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let connector_req = tsys::TsysSyncRequest::try_from(req)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
fn build_request(
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Post)
.url(&PaymentsSyncType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(PaymentsSyncType::get_headers(self, req, connectors)?)
.set_body(PaymentsSyncType::get_request_body(self, req, connectors)?)
.build(),
))
}
fn handle_response(
&self,
data: &PaymentsSyncRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {
let response: tsys::TsysSyncResponse = res
.response
.parse_struct("tsys PaymentsSyncResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}
impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Tsys {
fn get_headers(
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}
fn get_url(
&self,
_req: &PaymentsCaptureRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}servlets/transnox_api_server",
self.base_url(connectors)
))
}
fn get_request_body(
&self,
req: &PaymentsCaptureRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let amount = utils::convert_amount(
self.amount_converter,
req.request.minor_amount_to_capture,
req.request.currency,
)?;
let connector_router_data = tsys::TsysRouterData::from((amount, req));
let connector_req = tsys::TsysPaymentsCaptureRequest::try_from(&connector_router_data)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
fn build_request(
&self,
req: &PaymentsCaptureRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Post)
.url(&PaymentsCaptureType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(PaymentsCaptureType::get_headers(self, req, connectors)?)
.set_body(PaymentsCaptureType::get_request_body(
self, req, connectors,
)?)
.build(),
))
}
fn handle_response(
&self,
data: &PaymentsCaptureRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsCaptureRouterData, errors::ConnectorError> {
let response: tsys::TsysPaymentsResponse = res
.response
.parse_struct("Tsys PaymentsCaptureResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}
impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Tsys {
fn get_headers(
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}
fn get_url(
&self,
_req: &PaymentsCancelRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}servlets/transnox_api_server",
self.base_url(connectors),
))
}
fn get_request_body(
&self,
req: &PaymentsCancelRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let connector_req = tsys::TsysPaymentsCancelRequest::try_from(req)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
fn build_request(
&self,
req: &PaymentsCancelRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
let request = RequestBuilder::new()
.method(Method::Post)
.url(&PaymentsVoidType::get_url(self, req, connectors)?)
.headers(PaymentsVoidType::get_headers(self, req, connectors)?)
.set_body(PaymentsVoidType::get_request_body(self, req, connectors)?)
.build();
Ok(Some(request))
}
fn handle_response(
&self,
data: &PaymentsCancelRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsCancelRouterData, errors::ConnectorError> {
let response: tsys::TsysPaymentsResponse = res
.response
.parse_struct("PaymentCancelResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}
impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Tsys {
fn get_headers(
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}
fn get_url(
&self,
_req: &RefundsRouterData<Execute>,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}servlets/transnox_api_server",
self.base_url(connectors)
))
}
fn get_request_body(
&self,
req: &RefundsRouterData<Execute>,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let amount = utils::convert_amount(
self.amount_converter,
req.request.minor_refund_amount,
req.request.currency,
)?;
let connector_router_data = tsys::TsysRouterData::from((amount, req));
let connector_req = tsys::TsysRefundRequest::try_from(&connector_router_data)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
fn build_request(
&self,
req: &RefundsRouterData<Execute>,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
let request = RequestBuilder::new()
.method(Method::Post)
.url(&RefundExecuteType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(RefundExecuteType::get_headers(self, req, connectors)?)
.set_body(RefundExecuteType::get_request_body(self, req, connectors)?)
.build();
Ok(Some(request))
}
fn handle_response(
&self,
data: &RefundsRouterData<Execute>,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<RefundsRouterData<Execute>, errors::ConnectorError> {
let response: tsys::RefundResponse = res
.response
.parse_struct("tsys RefundResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}
impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Tsys {
fn get_headers(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}
fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}
fn get_url(
&self,
_req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}servlets/transnox_api_server",
self.base_url(connectors),
))
}
fn get_request_body(
&self,
req: &RefundSyncRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let connector_req = tsys::TsysSyncRequest::try_from(req)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
fn build_request(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Post)
.url(&RefundSyncType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(RefundSyncType::get_headers(self, req, connectors)?)
.set_body(RefundSyncType::get_request_body(self, req, connectors)?)
.build(),
))
}
fn handle_response(
&self,
data: &RefundSyncRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<RefundSyncRouterData, errors::ConnectorError> {
let response: tsys::TsysSyncResponse = res
.response
.parse_struct("tsys RefundSyncResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}
#[async_trait::async_trait]
impl webhooks::IncomingWebhook for Tsys {
fn get_webhook_object_reference_id(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
fn get_webhook_event_type(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<api_models::webhooks::IncomingWebhookEvent, errors::ConnectorError> {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
fn get_webhook_resource_object(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
}
static TSYS_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> = LazyLock::new(|| {
let supported_capture_methods = vec![
enums::CaptureMethod::Automatic,
enums::CaptureMethod::Manual,
enums::CaptureMethod::SequentialAutomatic,
];
let supported_card_network = vec![
common_enums::CardNetwork::Mastercard,
common_enums::CardNetwork::Visa,
common_enums::CardNetwork::AmericanExpress,
common_enums::CardNetwork::Discover,
common_enums::CardNetwork::JCB,
common_enums::CardNetwork::UnionPay,
];
let mut tsys_supported_payment_methods = SupportedPaymentMethods::new();
tsys_supported_payment_methods.add(
enums::PaymentMethod::Card,
enums::PaymentMethodType::Credit,
PaymentMethodDetails {
mandates: enums::FeatureStatus::NotSupported,
refunds: enums::FeatureStatus::Supported,
supported_capture_methods: supported_capture_methods.clone(),
specific_features: Some(
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
api_models::feature_matrix::CardSpecificFeatures {
three_ds: common_enums::FeatureStatus::NotSupported,
no_three_ds: common_enums::FeatureStatus::Supported,
supported_card_networks: supported_card_network.clone(),
}
}),
),
},
);
tsys_supported_payment_methods.add(
enums::PaymentMethod::Card,
enums::PaymentMethodType::Debit,
PaymentMethodDetails {
mandates: enums::FeatureStatus::NotSupported,
refunds: enums::FeatureStatus::Supported,
supported_capture_methods: supported_capture_methods.clone(),
specific_features: Some(
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
api_models::feature_matrix::CardSpecificFeatures {
three_ds: common_enums::FeatureStatus::NotSupported,
no_three_ds: common_enums::FeatureStatus::Supported,
supported_card_networks: supported_card_network.clone(),
}
}),
),
},
);
tsys_supported_payment_methods
});
static TSYS_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
display_name: "Tsys",
description: "TSYS, a Global Payments company, is the payment stack for the future, powered by unmatched expertise.",
connector_type: enums::HyperswitchConnectorCategory::BankAcquirer,
integration_status: enums::ConnectorIntegrationStatus::Beta,
};
static TSYS_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 0] = [];
impl ConnectorSpecifications for Tsys {
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
Some(&TSYS_CONNECTOR_INFO)
}
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
Some(&*TSYS_SUPPORTED_PAYMENT_METHODS)
}
fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
Some(&TSYS_SUPPORTED_WEBHOOK_FLOWS)
}
}
|
crates/hyperswitch_connectors/src/connectors/tsys.rs
|
hyperswitch_connectors
|
full_file
| null | null | null | 5,421
| null | null | null | null | null | null | null |
// Struct: VaultStruct
// File: crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct VaultStruct
|
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
VaultStruct
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Implementation: impl Responder
// File: crates/router/src/routes/payouts.rs
// Module: router
// Methods: 0 total (0 public)
impl Responder
|
crates/router/src/routes/payouts.rs
|
router
|
impl_block
| null | null | null | 37
| null |
Responder
| null | 0
| 0
| null | null |
// Implementation: impl api::RefundExecute for for Bankofamerica
// File: crates/hyperswitch_connectors/src/connectors/bankofamerica.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::RefundExecute for for Bankofamerica
|
crates/hyperswitch_connectors/src/connectors/bankofamerica.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 66
| null |
Bankofamerica
|
api::RefundExecute for
| 0
| 0
| null | null |
// Struct: PayeezyCaptureOrVoidRequest
// File: crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PayeezyCaptureOrVoidRequest
|
crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PayeezyCaptureOrVoidRequest
| 0
|
[] | 56
| null | null | null | null | null | null | null |
// Function: payments_cancel
// File: crates/router/src/routes/payments.rs
// Module: router
pub fn payments_cancel(
state: web::Data<app::AppState>,
req: actix_web::HttpRequest,
json_payload: web::Json<payment_types::PaymentsCancelRequest>,
path: web::Path<common_utils::id_type::PaymentId>,
) -> impl Responder
|
crates/router/src/routes/payments.rs
|
router
|
function_signature
| null | null | null | 83
|
payments_cancel
| null | null | null | null | null | null |
// Implementation: impl api::PaymentCapture for for Authipay
// File: crates/hyperswitch_connectors/src/connectors/authipay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentCapture for for Authipay
|
crates/hyperswitch_connectors/src/connectors/authipay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
Authipay
|
api::PaymentCapture for
| 0
| 0
| null | null |
// Struct: KlarnaRouterData
// File: crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct KlarnaRouterData<T>
|
crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
KlarnaRouterData
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// Struct: FiuuCardData
// File: crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct FiuuCardData
|
crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
FiuuCardData
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// Struct: FiservPaymentsRequest
// File: crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct FiservPaymentsRequest
|
crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
FiservPaymentsRequest
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// File: crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs
// Module: hyperswitch_connectors
// Public structs: 12
#[cfg(feature = "payouts")]
use api_models::enums::Currency;
#[cfg(feature = "payouts")]
use api_models::payouts::{Bank, PayoutMethodData};
#[cfg(feature = "payouts")]
use common_enums::{PayoutStatus, PayoutType};
#[cfg(feature = "payouts")]
use common_utils::pii::Email;
use common_utils::types::FloatMajorUnit;
use hyperswitch_domain_models::router_data::ConnectorAuthType;
#[cfg(feature = "payouts")]
use hyperswitch_domain_models::router_flow_types::PoCreate;
#[cfg(feature = "payouts")]
use hyperswitch_domain_models::types::{PayoutsResponseData, PayoutsRouterData};
use hyperswitch_interfaces::errors::ConnectorError;
#[cfg(feature = "payouts")]
use masking::ExposeInterface;
use masking::Secret;
use serde::{Deserialize, Serialize};
#[cfg(feature = "payouts")]
use crate::types::PayoutsResponseRouterData;
#[cfg(feature = "payouts")]
use crate::utils::{
AddressDetailsData as _, CustomerDetails as _, PayoutsData as _, RouterData as _,
};
pub struct EbanxRouterData<T> {
pub amount: FloatMajorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
pub router_data: T,
}
impl<T> From<(FloatMajorUnit, T)> for EbanxRouterData<T> {
fn from((amount, item): (FloatMajorUnit, T)) -> Self {
Self {
amount,
router_data: item,
}
}
}
#[cfg(feature = "payouts")]
#[derive(Debug, Serialize, Clone)]
pub struct EbanxPayoutCreateRequest {
integration_key: Secret<String>,
external_reference: String,
country: String,
amount: FloatMajorUnit,
currency: Currency,
target: EbanxPayoutType,
target_account: Secret<String>,
payee: EbanxPayoutDetails,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Serialize, Clone)]
pub enum EbanxPayoutType {
BankAccount,
Mercadopago,
EwalletNequi,
PixKey,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Serialize, Clone)]
pub struct EbanxPayoutDetails {
name: Secret<String>,
email: Option<Email>,
document: Option<Secret<String>>,
document_type: Option<EbanxDocumentType>,
bank_info: EbanxBankDetails,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Serialize, Clone)]
pub enum EbanxDocumentType {
#[serde(rename = "CPF")]
NaturalPersonsRegister,
#[serde(rename = "CNPJ")]
NationalRegistryOfLegalEntities,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Serialize, Clone)]
pub struct EbanxBankDetails {
bank_name: Option<String>,
bank_branch: Option<String>,
bank_account: Option<Secret<String>>,
account_type: Option<EbanxBankAccountType>,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Serialize, Clone)]
pub enum EbanxBankAccountType {
#[serde(rename = "C")]
CheckingAccount,
}
#[cfg(feature = "payouts")]
impl TryFrom<&EbanxRouterData<&PayoutsRouterData<PoCreate>>> for EbanxPayoutCreateRequest {
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: &EbanxRouterData<&PayoutsRouterData<PoCreate>>) -> Result<Self, Self::Error> {
let ebanx_auth_type = EbanxAuthType::try_from(&item.router_data.connector_auth_type)?;
match item.router_data.get_payout_method_data()? {
PayoutMethodData::Bank(Bank::Pix(pix_data)) => {
let bank_info = EbanxBankDetails {
bank_account: Some(pix_data.bank_account_number),
bank_branch: pix_data.bank_branch,
bank_name: pix_data.bank_name,
account_type: Some(EbanxBankAccountType::CheckingAccount),
};
let billing_address = item.router_data.get_billing_address()?;
let customer_details = item.router_data.request.get_customer_details()?;
let document_type = pix_data.tax_id.clone().map(|tax_id| {
if tax_id.clone().expose().len() == 11 {
EbanxDocumentType::NaturalPersonsRegister
} else {
EbanxDocumentType::NationalRegistryOfLegalEntities
}
});
let payee = EbanxPayoutDetails {
name: billing_address.get_full_name()?,
email: customer_details.email.clone(),
bank_info,
document_type,
document: pix_data.tax_id.to_owned(),
};
Ok(Self {
amount: item.amount,
integration_key: ebanx_auth_type.integration_key,
country: customer_details.get_customer_phone_country_code()?,
currency: item.router_data.request.source_currency,
external_reference: item.router_data.connector_request_reference_id.to_owned(),
target: EbanxPayoutType::PixKey,
target_account: pix_data.pix_key,
payee,
})
}
PayoutMethodData::Card(_) | PayoutMethodData::Bank(_) | PayoutMethodData::Wallet(_) => {
Err(ConnectorError::NotSupported {
message: "Payment Method Not Supported".to_string(),
connector: "Ebanx",
})?
}
}
}
}
pub struct EbanxAuthType {
pub integration_key: Secret<String>,
}
impl TryFrom<&ConnectorAuthType> for EbanxAuthType {
type Error = error_stack::Report<ConnectorError>;
fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
match auth_type {
ConnectorAuthType::HeaderKey { api_key } => Ok(Self {
integration_key: api_key.to_owned(),
}),
_ => Err(ConnectorError::FailedToObtainAuthType.into()),
}
}
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EbanxPayoutStatus {
#[serde(rename = "PA")]
Succeeded,
#[serde(rename = "CA")]
Cancelled,
#[serde(rename = "PE")]
Processing,
#[serde(rename = "OP")]
RequiresFulfillment,
}
#[cfg(feature = "payouts")]
impl From<EbanxPayoutStatus> for PayoutStatus {
fn from(item: EbanxPayoutStatus) -> Self {
match item {
EbanxPayoutStatus::Succeeded => Self::Success,
EbanxPayoutStatus::Cancelled => Self::Cancelled,
EbanxPayoutStatus::Processing => Self::Pending,
EbanxPayoutStatus::RequiresFulfillment => Self::RequiresFulfillment,
}
}
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbanxPayoutResponse {
payout: EbanxPayoutResponseDetails,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbanxPayoutResponseDetails {
uid: String,
status: EbanxPayoutStatus,
}
#[cfg(feature = "payouts")]
impl<F> TryFrom<PayoutsResponseRouterData<F, EbanxPayoutResponse>> for PayoutsRouterData<F> {
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: PayoutsResponseRouterData<F, EbanxPayoutResponse>,
) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(PayoutsResponseData {
status: Some(PayoutStatus::from(item.response.payout.status)),
connector_payout_id: Some(item.response.payout.uid),
payout_eligible: None,
should_add_next_step_to_process_tracker: false,
error_code: None,
error_message: None,
}),
..item.data
})
}
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbanxPayoutFulfillRequest {
integration_key: Secret<String>,
uid: String,
}
#[cfg(feature = "payouts")]
impl<F> TryFrom<&EbanxRouterData<&PayoutsRouterData<F>>> for EbanxPayoutFulfillRequest {
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: &EbanxRouterData<&PayoutsRouterData<F>>) -> Result<Self, Self::Error> {
let request = item.router_data.request.to_owned();
let ebanx_auth_type = EbanxAuthType::try_from(&item.router_data.connector_auth_type)?;
let payout_type = request.get_payout_type()?;
match payout_type {
PayoutType::Bank => Ok(Self {
integration_key: ebanx_auth_type.integration_key,
uid: request
.connector_payout_id
.to_owned()
.ok_or(ConnectorError::MissingRequiredField { field_name: "uid" })?,
}),
PayoutType::Card | PayoutType::Wallet => Err(ConnectorError::NotSupported {
message: "Payout Method Not Supported".to_string(),
connector: "Ebanx",
})?,
}
}
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbanxFulfillResponse {
#[serde(rename = "type")]
status: EbanxFulfillStatus,
message: String,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EbanxFulfillStatus {
Success,
ApiError,
AuthenticationError,
InvalidRequestError,
RequestError,
}
#[cfg(feature = "payouts")]
impl From<EbanxFulfillStatus> for PayoutStatus {
fn from(item: EbanxFulfillStatus) -> Self {
match item {
EbanxFulfillStatus::Success => Self::Success,
EbanxFulfillStatus::ApiError
| EbanxFulfillStatus::AuthenticationError
| EbanxFulfillStatus::InvalidRequestError
| EbanxFulfillStatus::RequestError => Self::Failed,
}
}
}
#[cfg(feature = "payouts")]
impl<F> TryFrom<PayoutsResponseRouterData<F, EbanxFulfillResponse>> for PayoutsRouterData<F> {
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: PayoutsResponseRouterData<F, EbanxFulfillResponse>,
) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(PayoutsResponseData {
status: Some(PayoutStatus::from(item.response.status)),
connector_payout_id: Some(item.data.request.get_transfer_id()?),
payout_eligible: None,
should_add_next_step_to_process_tracker: false,
error_code: None,
error_message: None,
}),
..item.data
})
}
}
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
pub struct EbanxErrorResponse {
pub code: String,
pub status_code: String,
pub message: Option<String>,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbanxPayoutCancelRequest {
integration_key: Secret<String>,
uid: String,
}
#[cfg(feature = "payouts")]
impl<F> TryFrom<&PayoutsRouterData<F>> for EbanxPayoutCancelRequest {
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: &PayoutsRouterData<F>) -> Result<Self, Self::Error> {
let request = item.request.to_owned();
let ebanx_auth_type = EbanxAuthType::try_from(&item.connector_auth_type)?;
let payout_type = request.get_payout_type()?;
match payout_type {
PayoutType::Bank => Ok(Self {
integration_key: ebanx_auth_type.integration_key,
uid: request
.connector_payout_id
.to_owned()
.ok_or(ConnectorError::MissingRequiredField { field_name: "uid" })?,
}),
PayoutType::Card | PayoutType::Wallet => Err(ConnectorError::NotSupported {
message: "Payout Method Not Supported".to_string(),
connector: "Ebanx",
})?,
}
}
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EbanxCancelResponse {
#[serde(rename = "type")]
status: EbanxCancelStatus,
message: String,
}
#[cfg(feature = "payouts")]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EbanxCancelStatus {
Success,
ApiError,
AuthenticationError,
InvalidRequestError,
RequestError,
}
#[cfg(feature = "payouts")]
impl From<EbanxCancelStatus> for PayoutStatus {
fn from(item: EbanxCancelStatus) -> Self {
match item {
EbanxCancelStatus::Success => Self::Cancelled,
EbanxCancelStatus::ApiError
| EbanxCancelStatus::AuthenticationError
| EbanxCancelStatus::InvalidRequestError
| EbanxCancelStatus::RequestError => Self::Failed,
}
}
}
#[cfg(feature = "payouts")]
impl<F> TryFrom<PayoutsResponseRouterData<F, EbanxCancelResponse>> for PayoutsRouterData<F> {
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: PayoutsResponseRouterData<F, EbanxCancelResponse>,
) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(PayoutsResponseData {
status: Some(PayoutStatus::from(item.response.status)),
connector_payout_id: item.data.request.connector_payout_id.clone(),
payout_eligible: None,
should_add_next_step_to_process_tracker: false,
error_code: None,
error_message: None,
}),
..item.data
})
}
}
|
crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs
|
hyperswitch_connectors
|
full_file
| null | null | null | 3,144
| null | null | null | null | null | null | null |
// Function: set_routable_connectors
// File: crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// Module: hyperswitch_interfaces
// Documentation: set response status code
pub fn set_routable_connectors(&mut self, connectors: Vec<RoutableConnectorChoice>)
|
crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
|
hyperswitch_interfaces
|
function_signature
| null | null | null | 63
|
set_routable_connectors
| null | null | null | null | null | null |
// File: crates/router/tests/connectors/elavon.rs
// Module: router
use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
use masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
use crate::utils::{self, ConnectorActions};
#[derive(Clone, Copy)]
struct ElavonTest;
impl ConnectorActions for ElavonTest {}
impl utils::Connector for ElavonTest {
fn get_data(&self) -> api::ConnectorData {
use router::connector::Elavon;
utils::construct_connector_data_old(
Box::new(Elavon::new()),
types::Connector::Plaid,
api::GetToken::Connector,
None,
)
// api::ConnectorData {
// connector: Box::new(Elavon::new()),
// connector_name: types::Connector::Elavon,
// get_token: types::api::GetToken::Connector,
// merchant_connector_id: None,
// }
}
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.elavon
.expect("Missing connector authentication configuration")
.into(),
)
}
fn get_name(&self) -> String {
"elavon".to_string()
}
}
static CONNECTOR: ElavonTest = ElavonTest {};
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
// Cards Positive Tests
// Creates a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_only_authorize_payment() {
let response = CONNECTOR
.authorize_payment(payment_method_details(), get_default_payment_info())
.await
.expect("Authorize payment response");
assert_eq!(response.status, enums::AttemptStatus::Authorized);
}
// Captures a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_capture_authorized_payment() {
let response = CONNECTOR
.authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info())
.await
.expect("Capture payment response");
assert_eq!(response.status, enums::AttemptStatus::Charged);
}
// Partially captures a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_partially_capture_authorized_payment() {
let response = CONNECTOR
.authorize_and_capture_payment(
payment_method_details(),
Some(types::PaymentsCaptureData {
amount_to_capture: 50,
..utils::PaymentCaptureType::default().0
}),
get_default_payment_info(),
)
.await
.expect("Capture payment response");
assert_eq!(response.status, enums::AttemptStatus::Charged);
}
// Synchronizes a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_authorized_payment() {
let authorize_response = CONNECTOR
.authorize_payment(payment_method_details(), get_default_payment_info())
.await
.expect("Authorize payment response");
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
let response = CONNECTOR
.psync_retry_till_status_matches(
enums::AttemptStatus::Authorized,
Some(types::PaymentsSyncData {
connector_transaction_id: types::ResponseId::ConnectorTransactionId(
txn_id.unwrap(),
),
..Default::default()
}),
get_default_payment_info(),
)
.await
.expect("PSync response");
assert_eq!(response.status, enums::AttemptStatus::Authorized,);
}
// Voids a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_void_authorized_payment() {
let response = CONNECTOR
.authorize_and_void_payment(
payment_method_details(),
Some(types::PaymentsCancelData {
connector_transaction_id: String::from(""),
cancellation_reason: Some("requested_by_customer".to_string()),
..Default::default()
}),
get_default_payment_info(),
)
.await
.expect("Void payment response");
assert_eq!(response.status, enums::AttemptStatus::Voided);
}
// Refunds a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_refund_manually_captured_payment() {
let response = CONNECTOR
.capture_payment_and_refund(
payment_method_details(),
None,
None,
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Partially refunds a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_partially_refund_manually_captured_payment() {
let response = CONNECTOR
.capture_payment_and_refund(
payment_method_details(),
None,
Some(types::RefundsData {
refund_amount: 50,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Synchronizes a refund using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_manually_captured_refund() {
let refund_response = CONNECTOR
.capture_payment_and_refund(
payment_method_details(),
None,
None,
get_default_payment_info(),
)
.await
.unwrap();
let response = CONNECTOR
.rsync_retry_till_status_matches(
enums::RefundStatus::Success,
refund_response.response.unwrap().connector_refund_id,
None,
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Creates a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_make_payment() {
let authorize_response = CONNECTOR
.make_payment(payment_method_details(), get_default_payment_info())
.await
.unwrap();
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
}
// Synchronizes a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_auto_captured_payment() {
let authorize_response = CONNECTOR
.make_payment(payment_method_details(), get_default_payment_info())
.await
.unwrap();
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
assert_ne!(txn_id, None, "Empty connector transaction id");
let response = CONNECTOR
.psync_retry_till_status_matches(
enums::AttemptStatus::Charged,
Some(types::PaymentsSyncData {
connector_transaction_id: types::ResponseId::ConnectorTransactionId(
txn_id.unwrap(),
),
capture_method: Some(enums::CaptureMethod::Automatic),
..Default::default()
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(response.status, enums::AttemptStatus::Charged,);
}
// Refunds a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_refund_auto_captured_payment() {
let response = CONNECTOR
.make_payment_and_refund(payment_method_details(), None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Partially refunds a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_partially_refund_succeeded_payment() {
let refund_response = CONNECTOR
.make_payment_and_refund(
payment_method_details(),
Some(types::RefundsData {
refund_amount: 50,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
refund_response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_refund_succeeded_payment_multiple_times() {
CONNECTOR
.make_payment_and_multiple_refund(
payment_method_details(),
Some(types::RefundsData {
refund_amount: 50,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await;
}
// Synchronizes a refund using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_refund() {
let refund_response = CONNECTOR
.make_payment_and_refund(payment_method_details(), None, get_default_payment_info())
.await
.unwrap();
let response = CONNECTOR
.rsync_retry_till_status_matches(
enums::RefundStatus::Success,
refund_response.response.unwrap().connector_refund_id,
None,
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Cards Negative scenarios
// Creates a payment with incorrect CVC.
#[actix_web::test]
async fn should_fail_payment_for_incorrect_cvc() {
let response = CONNECTOR
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: PaymentMethodData::Card(Card {
card_cvc: Secret::new("12345".to_string()),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Your card's security code is invalid.".to_string(),
);
}
// Creates a payment with incorrect expiry month.
#[actix_web::test]
async fn should_fail_payment_for_invalid_exp_month() {
let response = CONNECTOR
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: PaymentMethodData::Card(Card {
card_exp_month: Secret::new("20".to_string()),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Your card's expiration month is invalid.".to_string(),
);
}
// Creates a payment with incorrect expiry year.
#[actix_web::test]
async fn should_fail_payment_for_incorrect_expiry_year() {
let response = CONNECTOR
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: PaymentMethodData::Card(Card {
card_exp_year: Secret::new("2000".to_string()),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Your card's expiration year is invalid.".to_string(),
);
}
// Voids a payment using automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_fail_void_payment_for_auto_capture() {
let authorize_response = CONNECTOR
.make_payment(payment_method_details(), get_default_payment_info())
.await
.unwrap();
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
assert_ne!(txn_id, None, "Empty connector transaction id");
let void_response = CONNECTOR
.void_payment(txn_id.unwrap(), None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
void_response.response.unwrap_err().message,
"You cannot cancel this PaymentIntent because it has a status of succeeded."
);
}
// Captures a payment using invalid connector payment id.
#[actix_web::test]
async fn should_fail_capture_for_invalid_payment() {
let capture_response = CONNECTOR
.capture_payment("123456789".to_string(), None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
capture_response.response.unwrap_err().message,
String::from("No such payment_intent: '123456789'")
);
}
// Refunds a payment with refund amount higher than payment amount.
#[actix_web::test]
async fn should_fail_for_refund_amount_higher_than_payment_amount() {
let response = CONNECTOR
.make_payment_and_refund(
payment_method_details(),
Some(types::RefundsData {
refund_amount: 150,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Refund amount (₹1.50) is greater than charge amount (₹1.00)",
);
}
// Connector dependent test cases goes here
// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests
|
crates/router/tests/connectors/elavon.rs
|
router
|
full_file
| null | null | null | 3,004
| null | null | null | null | null | null | null |
// Implementation: impl UserFromToken
// File: crates/router/src/utils/user.rs
// Module: router
// Methods: 3 total (0 public)
impl UserFromToken
|
crates/router/src/utils/user.rs
|
router
|
impl_block
| null | null | null | 37
| null |
UserFromToken
| null | 3
| 0
| null | null |
// Function: new
// File: crates/hyperswitch_constraint_graph/src/types.rs
// Module: hyperswitch_constraint_graph
pub fn new() -> Self
|
crates/hyperswitch_constraint_graph/src/types.rs
|
hyperswitch_constraint_graph
|
function_signature
| null | null | null | 33
|
new
| null | null | null | null | null | null |
// Struct: GooglePayPaymentProcessingDetails
// File: crates/router/src/core/payments.rs
// Module: router
// Implementations: 0
pub struct GooglePayPaymentProcessingDetails
|
crates/router/src/core/payments.rs
|
router
|
struct_definition
|
GooglePayPaymentProcessingDetails
| 0
|
[] | 39
| null | null | null | null | null | null | null |
// Struct: PowertranzBaseRequest
// File: crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PowertranzBaseRequest
|
crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PowertranzBaseRequest
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// Struct: BillwerkRouterData
// File: crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct BillwerkRouterData<T>
|
crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
BillwerkRouterData
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// Function: get_billing_merchant_connector_account_id
// File: crates/hyperswitch_domain_models/src/payments.rs
// Module: hyperswitch_domain_models
pub fn get_billing_merchant_connector_account_id(
&self,
) -> Option<id_type::MerchantConnectorAccountId>
|
crates/hyperswitch_domain_models/src/payments.rs
|
hyperswitch_domain_models
|
function_signature
| null | null | null | 60
|
get_billing_merchant_connector_account_id
| null | null | null | null | null | null |
// File: crates/router/src/core/health_check.rs
// Module: router
#[cfg(feature = "olap")]
use analytics::health_check::HealthCheck;
#[cfg(feature = "dynamic_routing")]
use api_models::health_check::HealthCheckMap;
use api_models::health_check::HealthState;
use error_stack::ResultExt;
use router_env::logger;
use crate::{
consts,
core::errors::{self, CustomResult},
routes::app,
services::api as services,
};
#[async_trait::async_trait]
pub trait HealthCheckInterface {
async fn health_check_db(&self) -> CustomResult<HealthState, errors::HealthCheckDBError>;
async fn health_check_redis(&self) -> CustomResult<HealthState, errors::HealthCheckRedisError>;
async fn health_check_locker(
&self,
) -> CustomResult<HealthState, errors::HealthCheckLockerError>;
async fn health_check_outgoing(&self)
-> CustomResult<HealthState, errors::HealthCheckOutGoing>;
#[cfg(feature = "olap")]
async fn health_check_analytics(&self)
-> CustomResult<HealthState, errors::HealthCheckDBError>;
#[cfg(feature = "olap")]
async fn health_check_opensearch(
&self,
) -> CustomResult<HealthState, errors::HealthCheckDBError>;
#[cfg(feature = "dynamic_routing")]
async fn health_check_grpc(
&self,
) -> CustomResult<HealthCheckMap, errors::HealthCheckGRPCServiceError>;
#[cfg(feature = "dynamic_routing")]
async fn health_check_decision_engine(
&self,
) -> CustomResult<HealthState, errors::HealthCheckDecisionEngineError>;
async fn health_check_unified_connector_service(
&self,
) -> CustomResult<HealthState, errors::HealthCheckUnifiedConnectorServiceError>;
}
#[async_trait::async_trait]
impl HealthCheckInterface for app::SessionState {
async fn health_check_db(&self) -> CustomResult<HealthState, errors::HealthCheckDBError> {
let db = &*self.store;
db.health_check_db().await?;
Ok(HealthState::Running)
}
async fn health_check_redis(&self) -> CustomResult<HealthState, errors::HealthCheckRedisError> {
let db = &*self.store;
let redis_conn = db
.get_redis_conn()
.change_context(errors::HealthCheckRedisError::RedisConnectionError)?;
redis_conn
.serialize_and_set_key_with_expiry(&"test_key".into(), "test_value", 30)
.await
.change_context(errors::HealthCheckRedisError::SetFailed)?;
logger::debug!("Redis set_key was successful");
redis_conn
.get_key::<()>(&"test_key".into())
.await
.change_context(errors::HealthCheckRedisError::GetFailed)?;
logger::debug!("Redis get_key was successful");
redis_conn
.delete_key(&"test_key".into())
.await
.change_context(errors::HealthCheckRedisError::DeleteFailed)?;
logger::debug!("Redis delete_key was successful");
Ok(HealthState::Running)
}
async fn health_check_locker(
&self,
) -> CustomResult<HealthState, errors::HealthCheckLockerError> {
let locker = &self.conf.locker;
if !locker.mock_locker {
let mut url = locker.host_rs.to_owned();
url.push_str(consts::LOCKER_HEALTH_CALL_PATH);
let request = services::Request::new(services::Method::Get, &url);
services::call_connector_api(self, request, "health_check_for_locker")
.await
.change_context(errors::HealthCheckLockerError::FailedToCallLocker)?
.map_err(|_| {
error_stack::report!(errors::HealthCheckLockerError::FailedToCallLocker)
})?;
Ok(HealthState::Running)
} else {
Ok(HealthState::NotApplicable)
}
}
#[cfg(feature = "olap")]
async fn health_check_analytics(
&self,
) -> CustomResult<HealthState, errors::HealthCheckDBError> {
let analytics = &self.pool;
match analytics {
analytics::AnalyticsProvider::Sqlx(client) => client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::SqlxAnalyticsError),
analytics::AnalyticsProvider::Clickhouse(client) => client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::ClickhouseAnalyticsError),
analytics::AnalyticsProvider::CombinedCkh(sqlx_client, ckh_client) => {
sqlx_client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::SqlxAnalyticsError)?;
ckh_client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::ClickhouseAnalyticsError)
}
analytics::AnalyticsProvider::CombinedSqlx(sqlx_client, ckh_client) => {
sqlx_client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::SqlxAnalyticsError)?;
ckh_client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::ClickhouseAnalyticsError)
}
}?;
Ok(HealthState::Running)
}
#[cfg(feature = "olap")]
async fn health_check_opensearch(
&self,
) -> CustomResult<HealthState, errors::HealthCheckDBError> {
if let Some(client) = self.opensearch_client.as_ref() {
client
.deep_health_check()
.await
.change_context(errors::HealthCheckDBError::OpensearchError)?;
Ok(HealthState::Running)
} else {
Ok(HealthState::NotApplicable)
}
}
async fn health_check_outgoing(
&self,
) -> CustomResult<HealthState, errors::HealthCheckOutGoing> {
let request = services::Request::new(services::Method::Get, consts::OUTGOING_CALL_URL);
services::call_connector_api(self, request, "outgoing_health_check")
.await
.map_err(|err| errors::HealthCheckOutGoing::OutGoingFailed {
message: err.to_string(),
})?
.map_err(|err| errors::HealthCheckOutGoing::OutGoingFailed {
message: format!(
"Got a non 200 status while making outgoing request. Error {:?}",
err.response
),
})?;
logger::debug!("Outgoing request successful");
Ok(HealthState::Running)
}
#[cfg(feature = "dynamic_routing")]
async fn health_check_grpc(
&self,
) -> CustomResult<HealthCheckMap, errors::HealthCheckGRPCServiceError> {
let health_client = &self.grpc_client.health_client;
let grpc_config = &self.conf.grpc_client;
let health_check_map = health_client
.perform_health_check(grpc_config)
.await
.change_context(errors::HealthCheckGRPCServiceError::FailedToCallService)?;
logger::debug!("Health check successful");
Ok(health_check_map)
}
#[cfg(feature = "dynamic_routing")]
async fn health_check_decision_engine(
&self,
) -> CustomResult<HealthState, errors::HealthCheckDecisionEngineError> {
if self.conf.open_router.dynamic_routing_enabled {
let url = format!("{}/{}", &self.conf.open_router.url, "health");
let request = services::Request::new(services::Method::Get, &url);
let _ = services::call_connector_api(self, request, "health_check_for_decision_engine")
.await
.change_context(
errors::HealthCheckDecisionEngineError::FailedToCallDecisionEngineService,
)?;
logger::debug!("Decision engine health check successful");
Ok(HealthState::Running)
} else {
logger::debug!("Decision engine health check not applicable");
Ok(HealthState::NotApplicable)
}
}
async fn health_check_unified_connector_service(
&self,
) -> CustomResult<HealthState, errors::HealthCheckUnifiedConnectorServiceError> {
if let Some(_ucs_client) = &self.grpc_client.unified_connector_service_client {
// For now, we'll just check if the client exists and is configured
// In the future, this could be enhanced to make an actual health check call
// to the unified connector service if it supports health check endpoints
logger::debug!("Unified Connector Service client is configured and available");
Ok(HealthState::Running)
} else {
logger::debug!("Unified Connector Service client not configured");
Ok(HealthState::NotApplicable)
}
}
}
|
crates/router/src/core/health_check.rs
|
router
|
full_file
| null | null | null | 1,914
| null | null | null | null | null | null | null |
// Implementation: impl CaptureSyncResponse
// File: crates/hyperswitch_domain_models/src/router_response_types.rs
// Module: hyperswitch_domain_models
// Methods: 2 total (2 public)
impl CaptureSyncResponse
|
crates/hyperswitch_domain_models/src/router_response_types.rs
|
hyperswitch_domain_models
|
impl_block
| null | null | null | 46
| null |
CaptureSyncResponse
| null | 2
| 2
| null | null |
// File: crates/storage_impl/src/mock_db.rs
// Module: storage_impl
// Public functions: 5
// Public structs: 1
use std::sync::Arc;
use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState};
use diesel_models as store;
use error_stack::ResultExt;
use futures::lock::{Mutex, MutexGuard};
use hyperswitch_domain_models::{
behaviour::{Conversion, ReverseConversion},
merchant_key_store::MerchantKeyStore,
payments::{payment_attempt::PaymentAttempt, PaymentIntent},
};
use redis_interface::RedisSettings;
use crate::{errors::StorageError, redis::RedisStore};
pub mod payment_attempt;
pub mod payment_intent;
#[cfg(feature = "payouts")]
pub mod payout_attempt;
#[cfg(feature = "payouts")]
pub mod payouts;
pub mod redis_conn;
#[cfg(not(feature = "payouts"))]
use hyperswitch_domain_models::{PayoutAttemptInterface, PayoutsInterface};
#[derive(Clone)]
pub struct MockDb {
pub addresses: Arc<Mutex<Vec<store::Address>>>,
pub configs: Arc<Mutex<Vec<store::Config>>>,
pub merchant_accounts: Arc<Mutex<Vec<store::MerchantAccount>>>,
pub merchant_connector_accounts: Arc<Mutex<Vec<store::MerchantConnectorAccount>>>,
pub payment_attempts: Arc<Mutex<Vec<PaymentAttempt>>>,
pub payment_intents: Arc<Mutex<Vec<PaymentIntent>>>,
pub payment_methods: Arc<Mutex<Vec<store::PaymentMethod>>>,
pub customers: Arc<Mutex<Vec<store::Customer>>>,
pub refunds: Arc<Mutex<Vec<store::Refund>>>,
pub processes: Arc<Mutex<Vec<store::ProcessTracker>>>,
pub redis: Arc<RedisStore>,
pub api_keys: Arc<Mutex<Vec<store::ApiKey>>>,
pub ephemeral_keys: Arc<Mutex<Vec<store::EphemeralKey>>>,
pub cards_info: Arc<Mutex<Vec<store::CardInfo>>>,
pub events: Arc<Mutex<Vec<store::Event>>>,
pub disputes: Arc<Mutex<Vec<store::Dispute>>>,
pub lockers: Arc<Mutex<Vec<store::LockerMockUp>>>,
pub mandates: Arc<Mutex<Vec<store::Mandate>>>,
pub captures: Arc<Mutex<Vec<store::capture::Capture>>>,
pub merchant_key_store: Arc<Mutex<Vec<store::merchant_key_store::MerchantKeyStore>>>,
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
pub tokenizations: Arc<Mutex<Vec<store::tokenization::Tokenization>>>,
pub business_profiles: Arc<Mutex<Vec<store::business_profile::Profile>>>,
pub reverse_lookups: Arc<Mutex<Vec<store::ReverseLookup>>>,
pub payment_link: Arc<Mutex<Vec<store::payment_link::PaymentLink>>>,
pub organizations: Arc<Mutex<Vec<store::organization::Organization>>>,
pub users: Arc<Mutex<Vec<store::user::User>>>,
pub user_roles: Arc<Mutex<Vec<store::user_role::UserRole>>>,
pub authorizations: Arc<Mutex<Vec<store::authorization::Authorization>>>,
pub dashboard_metadata: Arc<Mutex<Vec<store::user::dashboard_metadata::DashboardMetadata>>>,
#[cfg(feature = "payouts")]
pub payout_attempt: Arc<Mutex<Vec<store::payout_attempt::PayoutAttempt>>>,
#[cfg(feature = "payouts")]
pub payouts: Arc<Mutex<Vec<store::payouts::Payouts>>>,
pub authentications: Arc<Mutex<Vec<store::authentication::Authentication>>>,
pub roles: Arc<Mutex<Vec<store::role::Role>>>,
pub user_key_store: Arc<Mutex<Vec<store::user_key_store::UserKeyStore>>>,
pub user_authentication_methods:
Arc<Mutex<Vec<store::user_authentication_method::UserAuthenticationMethod>>>,
pub themes: Arc<Mutex<Vec<store::user::theme::Theme>>>,
pub hyperswitch_ai_interactions:
Arc<Mutex<Vec<store::hyperswitch_ai_interaction::HyperswitchAiInteraction>>>,
}
impl MockDb {
pub async fn new(redis: &RedisSettings) -> error_stack::Result<Self, StorageError> {
Ok(Self {
addresses: Default::default(),
configs: Default::default(),
merchant_accounts: Default::default(),
merchant_connector_accounts: Default::default(),
payment_attempts: Default::default(),
payment_intents: Default::default(),
payment_methods: Default::default(),
customers: Default::default(),
refunds: Default::default(),
processes: Default::default(),
redis: Arc::new(
RedisStore::new(redis)
.await
.change_context(StorageError::InitializationError)?,
),
api_keys: Default::default(),
ephemeral_keys: Default::default(),
cards_info: Default::default(),
events: Default::default(),
disputes: Default::default(),
lockers: Default::default(),
mandates: Default::default(),
captures: Default::default(),
merchant_key_store: Default::default(),
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
tokenizations: Default::default(),
business_profiles: Default::default(),
reverse_lookups: Default::default(),
payment_link: Default::default(),
organizations: Default::default(),
users: Default::default(),
user_roles: Default::default(),
authorizations: Default::default(),
dashboard_metadata: Default::default(),
#[cfg(feature = "payouts")]
payout_attempt: Default::default(),
#[cfg(feature = "payouts")]
payouts: Default::default(),
authentications: Default::default(),
roles: Default::default(),
user_key_store: Default::default(),
user_authentication_methods: Default::default(),
themes: Default::default(),
hyperswitch_ai_interactions: Default::default(),
})
}
/// Returns an option of the resource if it exists
pub async fn find_resource<D, R>(
&self,
state: &KeyManagerState,
key_store: &MerchantKeyStore,
resources: MutexGuard<'_, Vec<D>>,
filter_fn: impl Fn(&&D) -> bool,
) -> CustomResult<Option<R>, StorageError>
where
D: Sync + ReverseConversion<R> + Clone,
R: Conversion,
{
let resource = resources.iter().find(filter_fn).cloned();
match resource {
Some(res) => Ok(Some(
res.convert(
state,
key_store.key.get_inner(),
key_store.merchant_id.clone().into(),
)
.await
.change_context(StorageError::DecryptionError)?,
)),
None => Ok(None),
}
}
/// Throws errors when the requested resource is not found
pub async fn get_resource<D, R>(
&self,
state: &KeyManagerState,
key_store: &MerchantKeyStore,
resources: MutexGuard<'_, Vec<D>>,
filter_fn: impl Fn(&&D) -> bool,
error_message: String,
) -> CustomResult<R, StorageError>
where
D: Sync + ReverseConversion<R> + Clone,
R: Conversion,
{
match self
.find_resource(state, key_store, resources, filter_fn)
.await?
{
Some(res) => Ok(res),
None => Err(StorageError::ValueNotFound(error_message).into()),
}
}
pub async fn get_resources<D, R>(
&self,
state: &KeyManagerState,
key_store: &MerchantKeyStore,
resources: MutexGuard<'_, Vec<D>>,
filter_fn: impl Fn(&&D) -> bool,
error_message: String,
) -> CustomResult<Vec<R>, StorageError>
where
D: Sync + ReverseConversion<R> + Clone,
R: Conversion,
{
let resources: Vec<_> = resources.iter().filter(filter_fn).cloned().collect();
if resources.is_empty() {
Err(StorageError::ValueNotFound(error_message).into())
} else {
let pm_futures = resources
.into_iter()
.map(|pm| async {
pm.convert(
state,
key_store.key.get_inner(),
key_store.merchant_id.clone().into(),
)
.await
.change_context(StorageError::DecryptionError)
})
.collect::<Vec<_>>();
let domain_resources = futures::future::try_join_all(pm_futures).await?;
Ok(domain_resources)
}
}
pub async fn update_resource<D, R>(
&self,
state: &KeyManagerState,
key_store: &MerchantKeyStore,
mut resources: MutexGuard<'_, Vec<D>>,
resource_updated: D,
filter_fn: impl Fn(&&mut D) -> bool,
error_message: String,
) -> CustomResult<R, StorageError>
where
D: Sync + ReverseConversion<R> + Clone,
R: Conversion,
{
if let Some(pm) = resources.iter_mut().find(filter_fn) {
*pm = resource_updated.clone();
let result = resource_updated
.convert(
state,
key_store.key.get_inner(),
key_store.merchant_id.clone().into(),
)
.await
.change_context(StorageError::DecryptionError)?;
Ok(result)
} else {
Err(StorageError::ValueNotFound(error_message).into())
}
}
}
#[cfg(not(feature = "payouts"))]
impl PayoutsInterface for MockDb {}
#[cfg(not(feature = "payouts"))]
impl PayoutAttemptInterface for MockDb {}
|
crates/storage_impl/src/mock_db.rs
|
storage_impl
|
full_file
| null | null | null | 2,090
| null | null | null | null | null | null | null |
// Function: validate
// File: crates/router/src/services/kafka.rs
// Module: router
pub fn validate(&self) -> Result<(), crate::core::errors::ApplicationError>
|
crates/router/src/services/kafka.rs
|
router
|
function_signature
| null | null | null | 39
|
validate
| null | null | null | null | null | null |
// Struct: ReturnUrl
// File: crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ReturnUrl
|
crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ReturnUrl
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Struct: MerchantAccountSetter
// File: crates/diesel_models/src/merchant_account.rs
// Module: diesel_models
// Implementations: 0
pub struct MerchantAccountSetter
|
crates/diesel_models/src/merchant_account.rs
|
diesel_models
|
struct_definition
|
MerchantAccountSetter
| 0
|
[] | 38
| null | null | null | null | null | null | null |
// Implementation: impl SecretsManagementConfig
// File: crates/external_services/src/managers/secrets_management.rs
// Module: external_services
// Methods: 2 total (1 public)
impl SecretsManagementConfig
|
crates/external_services/src/managers/secrets_management.rs
|
external_services
|
impl_block
| null | null | null | 43
| null |
SecretsManagementConfig
| null | 2
| 1
| null | null |
// Struct: PaymentFilterRow
// File: crates/analytics/src/payments/filters.rs
// Module: analytics
// Implementations: 0
pub struct PaymentFilterRow
|
crates/analytics/src/payments/filters.rs
|
analytics
|
struct_definition
|
PaymentFilterRow
| 0
|
[] | 37
| null | null | null | null | null | null | null |
// Implementation: impl api::RefundExecute for for Vgs
// File: crates/hyperswitch_connectors/src/connectors/vgs.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::RefundExecute for for Vgs
|
crates/hyperswitch_connectors/src/connectors/vgs.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Vgs
|
api::RefundExecute for
| 0
| 0
| null | null |
// Implementation: impl super::active_payments::metrics::ActivePaymentsMetricAnalytics for for ClickhouseClient
// File: crates/analytics/src/clickhouse.rs
// Module: analytics
// Methods: 0 total (0 public)
impl super::active_payments::metrics::ActivePaymentsMetricAnalytics for for ClickhouseClient
|
crates/analytics/src/clickhouse.rs
|
analytics
|
impl_block
| null | null | null | 65
| null |
ClickhouseClient
|
super::active_payments::metrics::ActivePaymentsMetricAnalytics for
| 0
| 0
| null | null |
// Function: config_key_update
// File: crates/router/src/routes/configs.rs
// Module: router
pub fn config_key_update(
state: web::Data<AppState>,
req: HttpRequest,
path: web::Path<String>,
json_payload: web::Json<api_types::ConfigUpdate>,
) -> impl Responder
|
crates/router/src/routes/configs.rs
|
router
|
function_signature
| null | null | null | 70
|
config_key_update
| null | null | null | null | null | null |
// Struct: StoreCardReq
// File: crates/router/src/core/payment_methods/transformers.rs
// Module: router
// Implementations: 0
pub struct StoreCardReq
|
crates/router/src/core/payment_methods/transformers.rs
|
router
|
struct_definition
|
StoreCardReq
| 0
|
[] | 38
| null | null | null | null | null | null | null |
// Function: call_to_locker
// File: crates/router/src/core/locker_migration.rs
// Module: router
pub fn call_to_locker(
_state: &SessionState,
_payment_methods: Vec<domain::PaymentMethod>,
_customer_id: &id_type::CustomerId,
_merchant_id: &id_type::MerchantId,
_merchant_context: &domain::MerchantContext,
) -> CustomResult<usize, errors::ApiErrorResponse>
|
crates/router/src/core/locker_migration.rs
|
router
|
function_signature
| null | null | null | 97
|
call_to_locker
| null | null | null | null | null | null |
// Module Structure
// File: crates/hyperswitch_connectors/src/connectors/santander.rs
// Module: hyperswitch_connectors
// Public submodules:
pub mod transformers;
|
crates/hyperswitch_connectors/src/connectors/santander.rs
|
hyperswitch_connectors
|
module_structure
| null | null | null | 39
| null | null | null | null | null | 1
| 0
|
// Function: organization_create
// File: crates/router/src/routes/admin.rs
// Module: router
pub fn organization_create(
state: web::Data<AppState>,
req: HttpRequest,
json_payload: web::Json<admin::OrganizationCreateRequest>,
) -> HttpResponse
|
crates/router/src/routes/admin.rs
|
router
|
function_signature
| null | null | null | 57
|
organization_create
| null | null | null | null | null | null |
// Implementation: impl api::PaymentToken for for Nomupay
// File: crates/hyperswitch_connectors/src/connectors/nomupay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentToken for for Nomupay
|
crates/hyperswitch_connectors/src/connectors/nomupay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 61
| null |
Nomupay
|
api::PaymentToken for
| 0
| 0
| null | null |
// Function: add_payment_method_to_vault
// File: crates/router/src/core/payment_methods/vault.rs
// Module: router
pub fn add_payment_method_to_vault(
state: &routes::SessionState,
merchant_context: &domain::MerchantContext,
pmd: &domain::PaymentMethodVaultingData,
existing_vault_id: Option<domain::VaultId>,
customer_id: &id_type::GlobalCustomerId,
) -> CustomResult<pm_types::AddVaultResponse, errors::VaultError>
|
crates/router/src/core/payment_methods/vault.rs
|
router
|
function_signature
| null | null | null | 110
|
add_payment_method_to_vault
| null | null | null | null | null | null |
// Implementation: impl api::ConnectorAccessToken for for Moneris
// File: crates/hyperswitch_connectors/src/connectors/moneris.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::ConnectorAccessToken for for Moneris
|
crates/hyperswitch_connectors/src/connectors/moneris.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 61
| null |
Moneris
|
api::ConnectorAccessToken for
| 0
| 0
| null | null |
// Implementation: impl api::PaymentVoid for for Nomupay
// File: crates/hyperswitch_connectors/src/connectors/nomupay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentVoid for for Nomupay
|
crates/hyperswitch_connectors/src/connectors/nomupay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 61
| null |
Nomupay
|
api::PaymentVoid for
| 0
| 0
| null | null |
// File: crates/api_models/src/process_tracker.rs
// Module: api_models
#[cfg(feature = "v2")]
pub mod revenue_recovery;
|
crates/api_models/src/process_tracker.rs
|
api_models
|
full_file
| null | null | null | 30
| null | null | null | null | null | null | null |
// Function: list_multiple_merchant_accounts
// File: crates/diesel_models/src/query/merchant_account.rs
// Module: diesel_models
pub fn list_multiple_merchant_accounts(
conn: &PgPooledConn,
merchant_ids: Vec<common_utils::id_type::MerchantId>,
) -> StorageResult<Vec<Self>>
|
crates/diesel_models/src/query/merchant_account.rs
|
diesel_models
|
function_signature
| null | null | null | 69
|
list_multiple_merchant_accounts
| null | null | null | null | null | null |
// Implementation: impl ConnectorRedirectResponse for for Mollie
// File: crates/hyperswitch_connectors/src/connectors/mollie.rs
// Module: hyperswitch_connectors
// Methods: 1 total (0 public)
impl ConnectorRedirectResponse for for Mollie
|
crates/hyperswitch_connectors/src/connectors/mollie.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 58
| null |
Mollie
|
ConnectorRedirectResponse for
| 1
| 0
| null | null |
// Function: spawn_tracked_job
// File: crates/router/src/services/authentication/decision.rs
// Module: router
pub fn spawn_tracked_job<E, F>(future: F, request_type: &'static str)
|
crates/router/src/services/authentication/decision.rs
|
router
|
function_signature
| null | null | null | 46
|
spawn_tracked_job
| null | null | null | null | null | null |
// Function: transform_to_sql_values
// File: crates/analytics/src/query.rs
// Module: analytics
pub fn transform_to_sql_values(&mut self, values: &[impl ToSql<T>]) -> QueryResult<String>
|
crates/analytics/src/query.rs
|
analytics
|
function_signature
| null | null | null | 47
|
transform_to_sql_values
| null | null | null | null | null | null |
// Struct: JpmorganMerchantSoftware
// File: crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct JpmorganMerchantSoftware
|
crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
JpmorganMerchantSoftware
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// Struct: StaxRefundRequest
// File: crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct StaxRefundRequest
|
crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
StaxRefundRequest
| 0
|
[] | 51
| null | null | null | null | null | null | null |
// Struct: References
// File: crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct References
|
crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
References
| 0
|
[] | 43
| null | null | null | null | null | null | null |
// Function: get_or_generate_payment_id
// File: crates/router/src/routes/payments.rs
// Module: router
pub fn get_or_generate_payment_id(
payload: &mut payment_types::PaymentsRequest,
) -> errors::RouterResult<()>
|
crates/router/src/routes/payments.rs
|
router
|
function_signature
| null | null | null | 51
|
get_or_generate_payment_id
| null | null | null | null | null | null |
// Function: update_user_details
// File: crates/router/src/core/user.rs
// Module: router
pub fn update_user_details(
state: SessionState,
user_token: auth::UserFromToken,
req: user_api::UpdateUserAccountDetailsRequest,
_req_state: ReqState,
) -> UserResponse<()>
|
crates/router/src/core/user.rs
|
router
|
function_signature
| null | null | null | 69
|
update_user_details
| null | null | null | null | null | null |
// File: crates/common_types/src/primitive_wrappers.rs
// Module: common_types
// Public functions: 4
// Public structs: 9
pub use bool_wrappers::*;
pub use u32_wrappers::*;
mod bool_wrappers {
use std::ops::Deref;
use serde::{Deserialize, Serialize};
/// Bool that represents if Extended Authorization is Applied or not
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, diesel::expression::AsExpression,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct ExtendedAuthorizationAppliedBool(bool);
impl Deref for ExtendedAuthorizationAppliedBool {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<bool> for ExtendedAuthorizationAppliedBool {
fn from(value: bool) -> Self {
Self(value)
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for ExtendedAuthorizationAppliedBool
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>
for ExtendedAuthorizationAppliedBool
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
/// Bool that represents if Extended Authorization is Requested or not
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, diesel::expression::AsExpression,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct RequestExtendedAuthorizationBool(bool);
impl Deref for RequestExtendedAuthorizationBool {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<bool> for RequestExtendedAuthorizationBool {
fn from(value: bool) -> Self {
Self(value)
}
}
impl RequestExtendedAuthorizationBool {
/// returns the inner bool value
pub fn is_true(&self) -> bool {
self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for RequestExtendedAuthorizationBool
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>
for RequestExtendedAuthorizationBool
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
/// Bool that represents if Enable Partial Authorization is Requested or not
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, diesel::expression::AsExpression,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct EnablePartialAuthorizationBool(bool);
impl Deref for EnablePartialAuthorizationBool {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<bool> for EnablePartialAuthorizationBool {
fn from(value: bool) -> Self {
Self(value)
}
}
impl EnablePartialAuthorizationBool {
/// returns the inner bool value
pub fn is_true(&self) -> bool {
self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for EnablePartialAuthorizationBool
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>
for EnablePartialAuthorizationBool
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
/// Bool that represents if Extended Authorization is always Requested or not
#[derive(
Clone, Copy, Debug, Eq, PartialEq, diesel::expression::AsExpression, Serialize, Deserialize,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct AlwaysRequestExtendedAuthorization(bool);
impl Deref for AlwaysRequestExtendedAuthorization {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB>
for AlwaysRequestExtendedAuthorization
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>
for AlwaysRequestExtendedAuthorization
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
/// Bool that represents if Cvv should be collected during payment or not. Default is true
#[derive(
Clone, Copy, Debug, Eq, PartialEq, diesel::expression::AsExpression, Serialize, Deserialize,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct ShouldCollectCvvDuringPayment(bool);
impl Deref for ShouldCollectCvvDuringPayment {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for ShouldCollectCvvDuringPayment
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for ShouldCollectCvvDuringPayment
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
impl Default for ShouldCollectCvvDuringPayment {
/// Default for `ShouldCollectCvvDuringPayment` is `true`
fn default() -> Self {
Self(true)
}
}
/// Bool that represents if overcapture should always be requested
#[derive(
Clone, Copy, Debug, Eq, PartialEq, diesel::expression::AsExpression, Serialize, Deserialize,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct AlwaysEnableOvercaptureBool(bool);
impl AlwaysEnableOvercaptureBool {
/// returns the inner bool value
pub fn is_true(&self) -> bool {
self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for AlwaysEnableOvercaptureBool
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for AlwaysEnableOvercaptureBool
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
impl Default for AlwaysEnableOvercaptureBool {
/// Default for `AlwaysEnableOvercaptureBool` is `false`
fn default() -> Self {
Self(false)
}
}
/// Bool that represents if overcapture is requested for this payment
#[derive(
Clone, Copy, Debug, Eq, PartialEq, diesel::expression::AsExpression, Serialize, Deserialize,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct EnableOvercaptureBool(bool);
impl From<bool> for EnableOvercaptureBool {
fn from(value: bool) -> Self {
Self(value)
}
}
impl From<AlwaysEnableOvercaptureBool> for EnableOvercaptureBool {
fn from(item: AlwaysEnableOvercaptureBool) -> Self {
Self(item.is_true())
}
}
impl Deref for EnableOvercaptureBool {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for EnableOvercaptureBool
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for EnableOvercaptureBool
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
impl Default for EnableOvercaptureBool {
/// Default for `EnableOvercaptureBool` is `false`
fn default() -> Self {
Self(false)
}
}
/// Bool that represents if overcapture is applied for a payment by the connector
#[derive(
Clone, Copy, Debug, Eq, PartialEq, diesel::expression::AsExpression, Serialize, Deserialize,
)]
#[diesel(sql_type = diesel::sql_types::Bool)]
pub struct OvercaptureEnabledBool(bool);
impl OvercaptureEnabledBool {
/// Creates a new instance of `OvercaptureEnabledBool`
pub fn new(value: bool) -> Self {
Self(value)
}
}
impl Default for OvercaptureEnabledBool {
/// Default for `OvercaptureEnabledBool` is `false`
fn default() -> Self {
Self(false)
}
}
impl Deref for OvercaptureEnabledBool {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for OvercaptureEnabledBool
where
DB: diesel::backend::Backend,
bool: diesel::serialize::ToSql<diesel::sql_types::Bool, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for OvercaptureEnabledBool
where
DB: diesel::backend::Backend,
bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
bool::from_sql(value).map(Self)
}
}
}
mod u32_wrappers {
use std::ops::Deref;
use serde::{de::Error, Deserialize, Serialize};
use crate::consts::{
DEFAULT_DISPUTE_POLLING_INTERVAL_IN_HOURS, MAX_DISPUTE_POLLING_INTERVAL_IN_HOURS,
};
/// Time interval in hours for polling disputes
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, diesel::expression::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Integer)]
pub struct DisputePollingIntervalInHours(i32);
impl Deref for DisputePollingIntervalInHours {
type Target = i32;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<'de> Deserialize<'de> for DisputePollingIntervalInHours {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let val = i32::deserialize(deserializer)?;
if val < 0 {
Err(D::Error::custom(
"DisputePollingIntervalInHours cannot be negative",
))
} else if val > MAX_DISPUTE_POLLING_INTERVAL_IN_HOURS {
Err(D::Error::custom(
"DisputePollingIntervalInHours exceeds the maximum allowed value of 24",
))
} else {
Ok(Self(val))
}
}
}
impl diesel::deserialize::FromSql<diesel::sql_types::Integer, diesel::pg::Pg>
for DisputePollingIntervalInHours
{
fn from_sql(value: diesel::pg::PgValue<'_>) -> diesel::deserialize::Result<Self> {
i32::from_sql(value).map(Self)
}
}
impl diesel::serialize::ToSql<diesel::sql_types::Integer, diesel::pg::Pg>
for DisputePollingIntervalInHours
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, diesel::pg::Pg>,
) -> diesel::serialize::Result {
<i32 as diesel::serialize::ToSql<diesel::sql_types::Integer, diesel::pg::Pg>>::to_sql(
&self.0, out,
)
}
}
impl Default for DisputePollingIntervalInHours {
/// Default for `DisputePollingIntervalInHours` is `24`
fn default() -> Self {
Self(DEFAULT_DISPUTE_POLLING_INTERVAL_IN_HOURS)
}
}
}
|
crates/common_types/src/primitive_wrappers.rs
|
common_types
|
full_file
| null | null | null | 3,555
| null | null | null | null | null | null | null |
// Struct: CoingateRefundRequest
// File: crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct CoingateRefundRequest
|
crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
CoingateRefundRequest
| 0
|
[] | 54
| null | null | null | null | null | null | null |
// Implementation: impl api::subscriptions_v2::SubscriptionsV2 for for Recurly
// File: crates/hyperswitch_connectors/src/connectors/recurly.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::subscriptions_v2::SubscriptionsV2 for for Recurly
|
crates/hyperswitch_connectors/src/connectors/recurly.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 72
| null |
Recurly
|
api::subscriptions_v2::SubscriptionsV2 for
| 0
| 0
| null | null |
connectors::Tokenio,
connectors::Trustpay,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Wise,
connectors::Worldline,
connectors::Volt,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Wellsfargo,
connectors::Wellsfargopayout,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
#[cfg(feature = "frm")]
macro_rules! default_imp_for_new_connector_integration_frm_fulfillment {
($($path:ident::$connector:ident),*) => {
$(
impl FraudCheckFulfillmentV2 for $path::$connector {}
impl
ConnectorIntegrationV2<
Fulfillment,
FrmFlowData,
FraudCheckFulfillmentData,
FraudCheckResponseData,
> for $path::$connector
{}
)*
};
}
#[cfg(feature = "frm")]
default_imp_for_new_connector_integration_frm_fulfillment!(
connectors::Vgs,
connectors::Aci,
connectors::Adyen,
connectors::Adyenplatform,
connectors::Affirm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Authipay,
connectors::Authorizedotnet,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Bankofamerica,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Braintree,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Cybersource,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Getnet,
connectors::Gigadat,
connectors::Globalpay,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Hipay,
connectors::Helcim,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Iatapay,
connectors::Inespay,
connectors::Itaubank,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Klarna,
connectors::Loonio,
connectors::Nomupay,
connectors::Noon,
connectors::Nordea,
connectors::Novalnet,
connectors::Netcetera,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Nmi,
connectors::Payone,
connectors::Opayo,
connectors::Opennode,
connectors::Nuvei,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payme,
connectors::Paypal,
connectors::Paysafe,
connectors::Paystack,
connectors::Paytm,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Mifinity,
connectors::Mollie,
connectors::Moneris,
connectors::Mpgs,
connectors::Multisafepay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Stripe,
connectors::Square,
connectors::Stripebilling,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpay,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Wise,
connectors::Worldline,
connectors::Volt,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Wellsfargo,
connectors::Wellsfargopayout,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
#[cfg(feature = "frm")]
macro_rules! default_imp_for_new_connector_integration_frm_record_return {
($($path:ident::$connector:ident),*) => {
$(
impl FraudCheckRecordReturnV2 for $path::$connector {}
impl
ConnectorIntegrationV2<
RecordReturn,
FrmFlowData,
FraudCheckRecordReturnData,
FraudCheckResponseData,
> for $path::$connector
{}
)*
};
}
#[cfg(feature = "frm")]
default_imp_for_new_connector_integration_frm_record_return!(
connectors::Vgs,
connectors::Aci,
connectors::Adyen,
connectors::Adyenplatform,
connectors::Affirm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Authipay,
connectors::Authorizedotnet,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Bankofamerica,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Braintree,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Cybersource,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Getnet,
connectors::Gigadat,
connectors::Globalpay,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Hipay,
connectors::Helcim,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Iatapay,
connectors::Inespay,
connectors::Itaubank,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Klarna,
connectors::Loonio,
connectors::Nomupay,
connectors::Noon,
connectors::Nordea,
connectors::Novalnet,
connectors::Netcetera,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Nmi,
connectors::Payone,
connectors::Opayo,
connectors::Opennode,
connectors::Nuvei,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payme,
connectors::Paypal,
connectors::Paysafe,
connectors::Paystack,
connectors::Paytm,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Mifinity,
connectors::Mollie,
connectors::Moneris,
connectors::Mpgs,
connectors::Multisafepay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Stripe,
connectors::Square,
connectors::Stripebilling,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpay,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Wise,
connectors::Worldline,
connectors::Volt,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Wellsfargo,
connectors::Wellsfargopayout,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
macro_rules! default_imp_for_new_connector_integration_revoking_mandates {
($($path:ident::$connector:ident),*) => {
$( impl ConnectorMandateRevokeV2 for $path::$connector {}
impl
ConnectorIntegrationV2<
MandateRevoke,
MandateRevokeFlowData,
MandateRevokeRequestData,
MandateRevokeResponseData,
> for $path::$connector
{}
)*
};
}
default_imp_for_new_connector_integration_revoking_mandates!(
connectors::Paysafe,
connectors::Vgs,
connectors::Aci,
connectors::Adyen,
connectors::Adyenplatform,
connectors::Affirm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Authipay,
connectors::Authorizedotnet,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Bankofamerica,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Braintree,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Cybersource,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Getnet,
connectors::Gigadat,
connectors::Globalpay,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Hipay,
connectors::Helcim,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Iatapay,
connectors::Inespay,
connectors::Itaubank,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Klarna,
connectors::Loonio,
connectors::Nomupay,
connectors::Noon,
connectors::Nordea,
connectors::Novalnet,
connectors::Netcetera,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Nmi,
connectors::Payone,
connectors::Opayo,
connectors::Opennode,
connectors::Nuvei,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payme,
connectors::Paystack,
connectors::Paytm,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Mifinity,
connectors::Mollie,
connectors::Moneris,
connectors::Mpgs,
connectors::Multisafepay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Stripe,
connectors::Square,
connectors::Stripebilling,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpay,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Wise,
connectors::Worldline,
connectors::Volt,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Wellsfargo,
connectors::Wellsfargopayout,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
#[cfg(feature = "frm")]
macro_rules! default_imp_for_new_connector_integration_frm {
($($path:ident::$connector:ident),*) => {
$(
impl FraudCheckV2 for $path::$connector {}
)*
};
}
#[cfg(feature = "frm")]
default_imp_for_new_connector_integration_frm!(
connectors::Loonio,
connectors::Gigadat,
connectors::Affirm,
connectors::Paytm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Authipay,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Checkbook,
connectors::Coinbase,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Helcim,
connectors::Hipay,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Inespay,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Mpgs,
connectors::Mollie,
connectors::Multisafepay,
connectors::Netcetera,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Nmi,
connectors::Nomupay,
connectors::Nordea,
connectors::Novalnet,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payone,
connectors::Paysafe,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Stripe,
connectors::Square,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Vgs,
connectors::Volt,
connectors::Wise,
connectors::Worldline,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
macro_rules! default_imp_for_new_connector_integration_connector_authentication {
($($path:ident::$connector:ident),*) => {
$( impl ExternalAuthenticationV2 for $path::$connector {}
impl ConnectorAuthenticationV2 for $path::$connector {}
impl ConnectorPreAuthenticationV2 for $path::$connector {}
impl ConnectorPreAuthenticationVersionCallV2 for $path::$connector {}
impl ConnectorPostAuthenticationV2 for $path::$connector {}
impl
ConnectorIntegrationV2<
Authentication,
ExternalAuthenticationFlowData,
authentication::ConnectorAuthenticationRequestData,
AuthenticationResponseData,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
PreAuthentication,
ExternalAuthenticationFlowData,
authentication::PreAuthNRequestData,
AuthenticationResponseData,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
PreAuthenticationVersionCall,
ExternalAuthenticationFlowData,
authentication::PreAuthNRequestData,
AuthenticationResponseData,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
PostAuthentication,
ExternalAuthenticationFlowData,
authentication::ConnectorPostAuthenticationRequestData,
AuthenticationResponseData,
> for $path::$connector
{}
)*
};
}
default_imp_for_new_connector_integration_connector_authentication!(
connectors::Loonio,
connectors::Gigadat,
connectors::Affirm,
connectors::Paytm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Authipay,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Checkbook,
connectors::Coinbase,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Helcim,
connectors::Hipay,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Inespay,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Mpgs,
connectors::Mollie,
connectors::Multisafepay,
connectors::Netcetera,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Nomupay,
connectors::Nordea,
connectors::Novalnet,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Paysafe,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Stripe,
connectors::Square,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Vgs,
connectors::Volt,
connectors::Wise,
connectors::Worldline,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
macro_rules! default_imp_for_new_connector_integration_revenue_recovery {
($($path:ident::$connector:ident),*) => {
$( impl RevenueRecoveryV2 for $path::$connector {}
impl BillingConnectorPaymentsSyncIntegrationV2 for $path::$connector {}
impl RevenueRecoveryRecordBackV2 for $path::$connector {}
impl BillingConnectorInvoiceSyncIntegrationV2 for $path::$connector {}
impl
ConnectorIntegrationV2<
InvoiceRecordBack,
InvoiceRecordBackData,
InvoiceRecordBackRequest,
InvoiceRecordBackResponse,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
BillingConnectorPaymentsSync,
BillingConnectorPaymentsSyncFlowData,
BillingConnectorPaymentsSyncRequest,
BillingConnectorPaymentsSyncResponse,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncFlowData,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
> for $path::$connector
{}
)*
};
}
default_imp_for_new_connector_integration_revenue_recovery!(
connectors::Loonio,
connectors::Gigadat,
connectors::Affirm,
connectors::Paytm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Authipay,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Checkbook,
connectors::Coinbase,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Helcim,
connectors::Hipay,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Inespay,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Mpgs,
connectors::Mollie,
connectors::Multisafepay,
connectors::Netcetera,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Nmi,
connectors::Nomupay,
connectors::Nordea,
connectors::Novalnet,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payone,
connectors::Paysafe,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Stripe,
connectors::Square,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Vgs,
connectors::Volt,
connectors::Wise,
connectors::Worldline,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
macro_rules! default_imp_for_new_connector_integration_external_vault {
($($path:ident::$connector:ident),*) => {
$(
impl ExternalVaultInsertV2 for $path::$connector {}
impl ExternalVaultRetrieveV2 for $path::$connector {}
impl ExternalVaultDeleteV2 for $path::$connector {}
impl ExternalVaultCreateV2 for $path::$connector {}
impl
ConnectorIntegrationV2<
ExternalVaultInsertFlow,
VaultConnectorFlowData,
VaultRequestData,
VaultResponseData,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
ExternalVaultRetrieveFlow,
VaultConnectorFlowData,
VaultRequestData,
VaultResponseData,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
ExternalVaultDeleteFlow,
VaultConnectorFlowData,
VaultRequestData,
VaultResponseData,
> for $path::$connector
{}
impl
ConnectorIntegrationV2<
ExternalVaultCreateFlow,
VaultConnectorFlowData,
VaultRequestData,
VaultResponseData,
> for $path::$connector
{}
)*
};
}
default_imp_for_new_connector_integration_external_vault!(
connectors::Aci,
connectors::Adyen,
connectors::Adyenplatform,
connectors::Affirm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Archipel,
connectors::Authipay,
connectors::Authorizedotnet,
connectors::Barclaycard,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Bankofamerica,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Braintree,
connectors::Boku,
connectors::Breadpay,
connectors::Cashtocode,
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
connectors::CtpMastercard,
connectors::Custombilling,
connectors::Cybersource,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Getnet,
connectors::Gigadat,
connectors::Globalpay,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Hipay,
connectors::Helcim,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Iatapay,
connectors::Inespay,
connectors::Itaubank,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Klarna,
connectors::Loonio,
connectors::Netcetera,
connectors::Nordea,
connectors::Nomupay,
connectors::Noon,
connectors::Novalnet,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Opayo,
connectors::Opennode,
connectors::Nuvei,
connectors::Nmi,
connectors::Payone,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payme,
connectors::Paypal,
connectors::Paysafe,
connectors::Paystack,
connectors::Paytm,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Mifinity,
connectors::Mollie,
connectors::Moneris,
connectors::Mpgs,
connectors::Multisafepay,
connectors::Plaid,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Square,
connectors::Stripe,
connectors::Stripebilling,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpay,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Vgs,
connectors::Volt,
connectors::Worldline,
connectors::Wise,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Wellsfargo,
connectors::Wellsfargopayout,
connectors::Xendit,
connectors::Zen,
connectors::Zsl
);
macro_rules! default_imp_for_new_connector_integration_external_vault_proxy {
($($path:ident::$connector:ident),*) => {
$(
impl ExternalVaultProxyPaymentsCreate for $path::$connector {}
impl
ConnectorIntegrationV2<
ExternalVaultProxy,
PaymentFlowData,
ExternalVaultProxyPaymentsData,
PaymentsResponseData> for $path::$connector
{}
)*
};
}
default_imp_for_new_connector_integration_external_vault_proxy!(
connectors::Aci,
connectors::Adyen,
connectors::Adyenplatform,
connectors::Affirm,
connectors::Airwallex,
connectors::Amazonpay,
connectors::Archipel,
connectors::Authipay,
connectors::Authorizedotnet,
connectors::Bambora,
connectors::Bamboraapac,
connectors::Bankofamerica,
connectors::Barclaycard,
connectors::Billwerk,
connectors::Bitpay,
connectors::Blackhawknetwork,
connectors::Bluecode,
connectors::Bluesnap,
connectors::Braintree,
connectors::Breadpay,
connectors::Boku,
connectors::Cashtocode,
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
connectors::Custombilling,
connectors::Cybersource,
connectors::Datatrans,
connectors::Deutschebank,
connectors::Digitalvirgo,
connectors::Dlocal,
connectors::Dwolla,
connectors::Ebanx,
connectors::Elavon,
connectors::Facilitapay,
connectors::Finix,
connectors::Fiserv,
connectors::Fiservemea,
connectors::Fiuu,
connectors::Flexiti,
connectors::Forte,
connectors::Getnet,
connectors::Gigadat,
connectors::Globalpay,
connectors::Globepay,
connectors::Gocardless,
connectors::Gpayments,
connectors::Hipay,
connectors::Helcim,
connectors::HyperswitchVault,
connectors::Hyperwallet,
connectors::Iatapay,
connectors::Inespay,
connectors::Itaubank,
connectors::Jpmorgan,
connectors::Juspaythreedsserver,
connectors::Katapult,
connectors::Klarna,
connectors::Loonio,
connectors::Mifinity,
connectors::Mollie,
connectors::Moneris,
connectors::Mpgs,
connectors::Multisafepay,
connectors::Netcetera,
connectors::Nmi,
connectors::Nomupay,
connectors::Noon,
connectors::Nordea,
connectors::Novalnet,
connectors::Nexinets,
connectors::Nexixpay,
connectors::Opayo,
connectors::Opennode,
connectors::Nuvei,
connectors::Paybox,
connectors::Payeezy,
connectors::Payload,
connectors::Payme,
connectors::Payone,
connectors::Paypal,
connectors::Paysafe,
connectors::Paystack,
connectors::Paytm,
connectors::Payu,
connectors::Peachpayments,
connectors::Phonepe,
connectors::Placetopay,
connectors::Plaid,
connectors::Powertranz,
connectors::Prophetpay,
connectors::Rapyd,
connectors::Razorpay,
connectors::Recurly,
connectors::Redsys,
connectors::Riskified,
connectors::Santander,
connectors::Shift4,
connectors::Sift,
connectors::Silverflow,
connectors::Signifyd,
connectors::Stax,
connectors::Square,
connectors::Stripe,
connectors::Stripebilling,
connectors::Taxjar,
connectors::Tesouro,
connectors::Threedsecureio,
connectors::Thunes,
connectors::Tokenex,
connectors::Tokenio,
connectors::Trustpay,
connectors::Trustpayments,
connectors::Tsys,
connectors::UnifiedAuthenticationService,
connectors::Wise,
connectors::Worldline,
connectors::Worldpay,
connectors::Worldpayvantiv,
connectors::Worldpayxml,
connectors::Wellsfargo,
connectors::Wellsfargopayout,
connectors::Vgs,
connectors::Volt,
connectors::Xendit,
connectors::Zen,
connectors::Zsl,
connectors::CtpMastercard
);
|
crates/hyperswitch_connectors/src/default_implementations_v2.rs#chunk3
|
hyperswitch_connectors
|
chunk
| null | null | null | 7,857
| null | null | null | null | null | null | null |
// Struct: BlocklistFingerprint
// File: crates/diesel_models/src/blocklist_fingerprint.rs
// Module: diesel_models
// Implementations: 0
pub struct BlocklistFingerprint
|
crates/diesel_models/src/blocklist_fingerprint.rs
|
diesel_models
|
struct_definition
|
BlocklistFingerprint
| 0
|
[] | 41
| null | null | null | null | null | null | null |
// Struct: WellsfargoRefundResponse
// File: crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct WellsfargoRefundResponse
|
crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
WellsfargoRefundResponse
| 0
|
[] | 55
| null | null | null | null | null | null | null |
// Struct: ApiKeyExpiryReminder
// File: crates/router/src/services/email/types.rs
// Module: router
// Implementations: 1
// Traits: EmailData
pub struct ApiKeyExpiryReminder
|
crates/router/src/services/email/types.rs
|
router
|
struct_definition
|
ApiKeyExpiryReminder
| 1
|
[
"EmailData"
] | 45
| null | null | null | null | null | null | null |
// Struct: RoutingProfileMetadata
// File: crates/diesel_models/src/routing_algorithm.rs
// Module: diesel_models
// Implementations: 1
pub struct RoutingProfileMetadata
|
crates/diesel_models/src/routing_algorithm.rs
|
diesel_models
|
struct_definition
|
RoutingProfileMetadata
| 1
|
[] | 38
| null | null | null | null | null | null | null |
// Function: get_pending_captures
// File: crates/router/src/core/payments/types.rs
// Module: router
pub fn get_pending_captures(&self) -> Vec<&storage::Capture>
|
crates/router/src/core/payments/types.rs
|
router
|
function_signature
| null | null | null | 43
|
get_pending_captures
| null | null | null | null | null | null |
// Implementation: impl AuthServiceConnector for for T
// File: crates/pm_auth/src/types/api.rs
// Module: pm_auth
// Methods: 0 total (0 public)
impl AuthServiceConnector for for T
|
crates/pm_auth/src/types/api.rs
|
pm_auth
|
impl_block
| null | null | null | 43
| null |
T
|
AuthServiceConnector for
| 0
| 0
| null | null |
// Implementation: impl api::ConnectorAccessToken for for Noon
// File: crates/hyperswitch_connectors/src/connectors/noon.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::ConnectorAccessToken for for Noon
|
crates/hyperswitch_connectors/src/connectors/noon.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 55
| null |
Noon
|
api::ConnectorAccessToken for
| 0
| 0
| null | null |
// Struct: UserMerchantAccountResponse
// File: crates/api_models/src/user.rs
// Module: api_models
// Implementations: 0
pub struct UserMerchantAccountResponse
|
crates/api_models/src/user.rs
|
api_models
|
struct_definition
|
UserMerchantAccountResponse
| 0
|
[] | 37
| null | null | null | null | null | null | null |
// Struct: ContactDetails
// File: crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ContactDetails
|
crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ContactDetails
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Struct: ExternalVaultProxy
// File: crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
// Module: hyperswitch_domain_models
// Implementations: 0
pub struct ExternalVaultProxy
|
crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
|
hyperswitch_domain_models
|
struct_definition
|
ExternalVaultProxy
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Struct: PostAuthenticate
// File: crates/hyperswitch_domain_models/src/router_flow_types/unified_authentication_service.rs
// Module: hyperswitch_domain_models
// Implementations: 0
pub struct PostAuthenticate
|
crates/hyperswitch_domain_models/src/router_flow_types/unified_authentication_service.rs
|
hyperswitch_domain_models
|
struct_definition
|
PostAuthenticate
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Implementation: impl MerchantCountryCode
// File: crates/common_types/src/payments.rs
// Module: common_types
// Methods: 3 total (3 public)
impl MerchantCountryCode
|
crates/common_types/src/payments.rs
|
common_types
|
impl_block
| null | null | null | 39
| null |
MerchantCountryCode
| null | 3
| 3
| null | null |
// Struct: NetworkTokenResponse
// File: crates/api_models/src/payment_methods.rs
// Module: api_models
// Implementations: 0
pub struct NetworkTokenResponse
|
crates/api_models/src/payment_methods.rs
|
api_models
|
struct_definition
|
NetworkTokenResponse
| 0
|
[] | 36
| null | null | null | null | null | null | null |
// Function: find_by_theme_id
// File: crates/diesel_models/src/query/user/theme.rs
// Module: diesel_models
pub fn find_by_theme_id(conn: &PgPooledConn, theme_id: String) -> StorageResult<Self>
|
crates/diesel_models/src/query/user/theme.rs
|
diesel_models
|
function_signature
| null | null | null | 51
|
find_by_theme_id
| null | null | null | null | null | null |
// Function: create_merchant_connector_account
// File: crates/diesel_models/src/merchant_connector_account.rs
// Module: diesel_models
pub fn create_merchant_connector_account(
self,
source: MerchantConnectorAccount,
) -> MerchantConnectorAccount
|
crates/diesel_models/src/merchant_connector_account.rs
|
diesel_models
|
function_signature
| null | null | null | 53
|
create_merchant_connector_account
| null | null | null | null | null | null |
// Implementation: impl api::ConnectorMandateRevoke for for Braintree
// File: crates/hyperswitch_connectors/src/connectors/braintree.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::ConnectorMandateRevoke for for Braintree
|
crates/hyperswitch_connectors/src/connectors/braintree.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 66
| null |
Braintree
|
api::ConnectorMandateRevoke for
| 0
| 0
| null | null |
// Struct: HeaderKey
// File: crates/test_utils/src/connector_auth.rs
// Module: test_utils
// Implementations: 0
pub struct HeaderKey
|
crates/test_utils/src/connector_auth.rs
|
test_utils
|
struct_definition
|
HeaderKey
| 0
|
[] | 35
| null | null | null | null | null | null | null |
// Implementation: impl api::Payment for for Zsl
// File: crates/hyperswitch_connectors/src/connectors/zsl.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Payment for for Zsl
|
crates/hyperswitch_connectors/src/connectors/zsl.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 55
| null |
Zsl
|
api::Payment for
| 0
| 0
| null | null |
// File: crates/api_models/src/analytics/routing_events.rs
// Module: api_models
// Public structs: 1
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct RoutingEventsRequest {
pub payment_id: common_utils::id_type::PaymentId,
pub refund_id: Option<String>,
pub dispute_id: Option<String>,
}
|
crates/api_models/src/analytics/routing_events.rs
|
api_models
|
full_file
| null | null | null | 78
| null | null | null | null | null | null | null |
// Trait: DisputeMetricAnalytics
// File: crates/analytics/src/disputes/metrics.rs
// Module: analytics
pub trait DisputeMetricAnalytics: LoadRow<DisputeMetricRow>
|
crates/analytics/src/disputes/metrics.rs
|
analytics
|
trait_definition
| null | null | null | 42
| null | null |
DisputeMetricAnalytics
| null | null | null | null |
// Struct: TokenizedCardValue2
// File: crates/hyperswitch_domain_models/src/payment_method_data.rs
// Module: hyperswitch_domain_models
// Implementations: 0
pub struct TokenizedCardValue2
|
crates/hyperswitch_domain_models/src/payment_method_data.rs
|
hyperswitch_domain_models
|
struct_definition
|
TokenizedCardValue2
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Implementation: impl api::PaymentVoid for for Bluesnap
// File: crates/hyperswitch_connectors/src/connectors/bluesnap.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentVoid for for Bluesnap
|
crates/hyperswitch_connectors/src/connectors/bluesnap.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 58
| null |
Bluesnap
|
api::PaymentVoid for
| 0
| 0
| null | null |
// Function: validate
// File: crates/redis_interface/src/types.rs
// Module: redis_interface
// Documentation: Validates the Redis configuration provided.
pub fn validate(&self) -> CustomResult<(), errors::RedisError>
|
crates/redis_interface/src/types.rs
|
redis_interface
|
function_signature
| null | null | null | 46
|
validate
| null | null | null | null | null | null |
// Implementation: impl ForexMetric for for RefundMetrics
// File: crates/api_models/src/analytics/refunds.rs
// Module: api_models
// Methods: 1 total (0 public)
impl ForexMetric for for RefundMetrics
|
crates/api_models/src/analytics/refunds.rs
|
api_models
|
impl_block
| null | null | null | 49
| null |
RefundMetrics
|
ForexMetric for
| 1
| 0
| null | null |
// Implementation: impl api::Refund for for Paypal
// File: crates/hyperswitch_connectors/src/connectors/paypal.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Refund for for Paypal
|
crates/hyperswitch_connectors/src/connectors/paypal.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 55
| null |
Paypal
|
api::Refund for
| 0
| 0
| null | null |
// Struct: PaypalAccessTokenErrorResponse
// File: crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PaypalAccessTokenErrorResponse
|
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PaypalAccessTokenErrorResponse
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Function: get_config_directory
// File: crates/router_env/src/logger/config.rs
// Module: router_env
// Documentation: Read the env variable `CONFIG_DIR` or fallback to `config`
pub fn get_config_directory() -> PathBuf
|
crates/router_env/src/logger/config.rs
|
router_env
|
function_signature
| null | null | null | 50
|
get_config_directory
| null | null | null | null | null | null |
// Implementation: impl std::ops::DerefMut for for PayoutsMandateReference
// File: crates/hyperswitch_domain_models/src/mandates.rs
// Module: hyperswitch_domain_models
// Methods: 1 total (0 public)
impl std::ops::DerefMut for for PayoutsMandateReference
|
crates/hyperswitch_domain_models/src/mandates.rs
|
hyperswitch_domain_models
|
impl_block
| null | null | null | 72
| null |
PayoutsMandateReference
|
std::ops::DerefMut for
| 1
| 0
| null | null |
// Function: revenue_recovery_resume_api
// File: crates/router/src/routes/process_tracker/revenue_recovery.rs
// Module: router
pub fn revenue_recovery_resume_api(
state: web::Data<AppState>,
req: HttpRequest,
path: web::Path<common_utils::id_type::GlobalPaymentId>,
json_payload: web::Json<revenue_recovery_api::RevenueRecoveryRetriggerRequest>,
) -> HttpResponse
|
crates/router/src/routes/process_tracker/revenue_recovery.rs
|
router
|
function_signature
| null | null | null | 89
|
revenue_recovery_resume_api
| null | null | null | null | null | null |
// Struct: PayloadCurrencyAuthKeyType
// File: crates/connector_configs/src/connector.rs
// Module: connector_configs
// Implementations: 0
pub struct PayloadCurrencyAuthKeyType
|
crates/connector_configs/src/connector.rs
|
connector_configs
|
struct_definition
|
PayloadCurrencyAuthKeyType
| 0
|
[] | 39
| null | null | null | null | null | null | null |
// Function: derive_smithy_model
// File: crates/smithy/src/lib.rs
// Module: smithy
pub fn derive_smithy_model(input: TokenStream) -> TokenStream
|
crates/smithy/src/lib.rs
|
smithy
|
function_signature
| null | null | null | 41
|
derive_smithy_model
| null | null | null | null | null | null |
// Struct: VoltRouterData
// File: crates/hyperswitch_connectors/src/connectors/volt/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct VoltRouterData<T>
|
crates/hyperswitch_connectors/src/connectors/volt/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
VoltRouterData
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// File: crates/common_utils/src/request.rs
// Module: common_utils
// Public functions: 19
// Public structs: 2
use masking::{Maskable, Secret};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
pub type Headers = std::collections::HashSet<(String, Maskable<String>)>;
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Deserialize,
Serialize,
strum::Display,
strum::EnumString,
ToSchema,
)]
#[serde(rename_all = "UPPERCASE")]
#[strum(serialize_all = "UPPERCASE")]
pub enum Method {
Get,
Post,
Put,
Delete,
Patch,
}
#[derive(Deserialize, Serialize, Debug)]
pub enum ContentType {
Json,
FormUrlEncoded,
FormData,
Xml,
}
fn default_request_headers() -> [(String, Maskable<String>); 1] {
use http::header;
[(header::VIA.to_string(), "HyperSwitch".to_string().into())]
}
#[derive(Debug)]
pub struct Request {
pub url: String,
pub headers: Headers,
pub method: Method,
pub certificate: Option<Secret<String>>,
pub certificate_key: Option<Secret<String>>,
pub body: Option<RequestContent>,
pub ca_certificate: Option<Secret<String>>,
}
impl std::fmt::Debug for RequestContent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
Self::Json(_) => "JsonRequestBody",
Self::FormUrlEncoded(_) => "FormUrlEncodedRequestBody",
Self::FormData(_) => "FormDataRequestBody",
Self::Xml(_) => "XmlRequestBody",
Self::RawBytes(_) => "RawBytesRequestBody",
})
}
}
pub enum RequestContent {
Json(Box<dyn masking::ErasedMaskSerialize + Send>),
FormUrlEncoded(Box<dyn masking::ErasedMaskSerialize + Send>),
FormData(reqwest::multipart::Form),
Xml(Box<dyn masking::ErasedMaskSerialize + Send>),
RawBytes(Vec<u8>),
}
impl RequestContent {
pub fn get_inner_value(&self) -> Secret<String> {
match self {
Self::Json(i) => serde_json::to_string(&i).unwrap_or_default().into(),
Self::FormUrlEncoded(i) => serde_urlencoded::to_string(i).unwrap_or_default().into(),
Self::Xml(i) => quick_xml::se::to_string(&i).unwrap_or_default().into(),
Self::FormData(_) => String::new().into(),
Self::RawBytes(_) => String::new().into(),
}
}
}
impl Request {
pub fn new(method: Method, url: &str) -> Self {
Self {
method,
url: String::from(url),
headers: std::collections::HashSet::new(),
certificate: None,
certificate_key: None,
body: None,
ca_certificate: None,
}
}
pub fn set_body<T: Into<RequestContent>>(&mut self, body: T) {
self.body.replace(body.into());
}
pub fn add_default_headers(&mut self) {
self.headers.extend(default_request_headers());
}
pub fn add_header(&mut self, header: &str, value: Maskable<String>) {
self.headers.insert((String::from(header), value));
}
pub fn add_certificate(&mut self, certificate: Option<Secret<String>>) {
self.certificate = certificate;
}
pub fn add_certificate_key(&mut self, certificate_key: Option<Secret<String>>) {
self.certificate = certificate_key;
}
}
#[derive(Debug)]
pub struct RequestBuilder {
pub url: String,
pub headers: Headers,
pub method: Method,
pub certificate: Option<Secret<String>>,
pub certificate_key: Option<Secret<String>>,
pub body: Option<RequestContent>,
pub ca_certificate: Option<Secret<String>>,
}
impl RequestBuilder {
pub fn new() -> Self {
Self {
method: Method::Get,
url: String::with_capacity(1024),
headers: std::collections::HashSet::new(),
certificate: None,
certificate_key: None,
body: None,
ca_certificate: None,
}
}
pub fn url(mut self, url: &str) -> Self {
self.url = url.into();
self
}
pub fn method(mut self, method: Method) -> Self {
self.method = method;
self
}
pub fn attach_default_headers(mut self) -> Self {
self.headers.extend(default_request_headers());
self
}
pub fn header(mut self, header: &str, value: &str) -> Self {
self.headers.insert((header.into(), value.into()));
self
}
pub fn headers(mut self, headers: Vec<(String, Maskable<String>)>) -> Self {
self.headers.extend(headers);
self
}
pub fn set_optional_body<T: Into<RequestContent>>(mut self, body: Option<T>) -> Self {
body.map(|body| self.body.replace(body.into()));
self
}
pub fn set_body<T: Into<RequestContent>>(mut self, body: T) -> Self {
self.body.replace(body.into());
self
}
pub fn add_certificate(mut self, certificate: Option<Secret<String>>) -> Self {
self.certificate = certificate;
self
}
pub fn add_certificate_key(mut self, certificate_key: Option<Secret<String>>) -> Self {
self.certificate_key = certificate_key;
self
}
pub fn add_ca_certificate_pem(mut self, ca_certificate: Option<Secret<String>>) -> Self {
self.ca_certificate = ca_certificate;
self
}
pub fn build(self) -> Request {
Request {
method: self.method,
url: self.url,
headers: self.headers,
certificate: self.certificate,
certificate_key: self.certificate_key,
body: self.body,
ca_certificate: self.ca_certificate,
}
}
}
impl Default for RequestBuilder {
fn default() -> Self {
Self::new()
}
}
|
crates/common_utils/src/request.rs
|
common_utils
|
full_file
| null | null | null | 1,336
| null | null | null | null | null | null | null |
// Struct: PayoutsMandateReferenceRecord
// File: crates/hyperswitch_domain_models/src/mandates.rs
// Module: hyperswitch_domain_models
// Implementations: 0
pub struct PayoutsMandateReferenceRecord
|
crates/hyperswitch_domain_models/src/mandates.rs
|
hyperswitch_domain_models
|
struct_definition
|
PayoutsMandateReferenceRecord
| 0
|
[] | 53
| null | null | null | null | null | null | null |
// Function: server
// File: crates/router/src/compatibility/stripe/app.rs
// Module: router
pub fn server(config: routes::AppState) -> Scope
|
crates/router/src/compatibility/stripe/app.rs
|
router
|
function_signature
| null | null | null | 35
|
server
| null | null | null | null | null | null |
// Implementation: impl api::Refund for for Iatapay
// File: crates/hyperswitch_connectors/src/connectors/iatapay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Refund for for Iatapay
|
crates/hyperswitch_connectors/src/connectors/iatapay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 63
| null |
Iatapay
|
api::Refund for
| 0
| 0
| null | null |
// Struct: PayonePayoutFulfillRequest
// File: crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PayonePayoutFulfillRequest
|
crates/hyperswitch_connectors/src/connectors/payone/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PayonePayoutFulfillRequest
| 0
|
[] | 55
| null | null | null | null | null | null | null |
// Struct: CreateCustomerRequest
// File: crates/router/src/compatibility/stripe/customers/types.rs
// Module: router
// Implementations: 0
pub struct CreateCustomerRequest
|
crates/router/src/compatibility/stripe/customers/types.rs
|
router
|
struct_definition
|
CreateCustomerRequest
| 0
|
[] | 40
| null | null | null | null | null | null | null |
// Implementation: impl ConnectorSpecifications for for Forte
// File: crates/hyperswitch_connectors/src/connectors/forte.rs
// Module: hyperswitch_connectors
// Methods: 3 total (0 public)
impl ConnectorSpecifications for for Forte
|
crates/hyperswitch_connectors/src/connectors/forte.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 54
| null |
Forte
|
ConnectorSpecifications for
| 3
| 0
| null | null |
// Struct: OpenMsearchOutput
// File: crates/api_models/src/analytics/search.rs
// Module: api_models
// Implementations: 0
pub struct OpenMsearchOutput
|
crates/api_models/src/analytics/search.rs
|
api_models
|
struct_definition
|
OpenMsearchOutput
| 0
|
[] | 39
| null | null | null | null | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.