text
string
file_path
string
module
string
type
string
tokens
int64
language
string
struct_name
string
type_name
string
trait_name
string
impl_type
string
function_name
string
source
string
section
string
keys
list
macro_type
string
url
string
title
string
chunk_index
int64
pub const fn new() -> &'static Self { &Self { amount_converter: &MinorUnitForConnector, apple_pay_google_pay_amount_converter: &StringMajorUnitForConnector, amount_converter_webhooks: &StringMinorUnitForConnector, } }
crates/hyperswitch_connectors/src/connectors/payme.rs
hyperswitch_connectors
function_signature
56
rust
null
null
null
null
new
null
null
null
null
null
null
null
File: crates/analytics/src/payments.rs pub mod accumulator; mod core; pub mod distribution; pub mod filters; pub mod metrics; pub mod types; pub use accumulator::{ PaymentDistributionAccumulator, PaymentMetricAccumulator, PaymentMetricsAccumulator, }; pub trait PaymentAnalytics: metrics::PaymentMetricAnalytic...
crates/analytics/src/payments.rs
analytics
full_file
89
null
null
null
null
null
null
null
null
null
null
null
null
null
pub struct ApiEventFilter { pub status_code: Option<i32>, pub flow_type: Option<String>, pub api_flow: Option<String>, }
crates/analytics/src/api_event/filters.rs
analytics
struct_definition
33
rust
ApiEventFilter
null
null
null
null
null
null
null
null
null
null
null
pub async fn insert_payout_link(self, conn: &PgPooledConn) -> StorageResult<PayoutLink> { generics::generic_insert(conn, self) .await .and_then(|res: GenericLink| { PayoutLink::try_from(res) .change_context(db_errors::DatabaseError::Others) ...
crates/diesel_models/src/query/generic_link.rs
diesel_models
function_signature
89
rust
null
null
null
null
insert_payout_link
null
null
null
null
null
null
null
impl api::PaymentSession for Deutschebank {}
crates/hyperswitch_connectors/src/connectors/deutschebank.rs
hyperswitch_connectors
impl_block
9
rust
null
Deutschebank
api::PaymentSession for
impl api::PaymentSession for for Deutschebank
null
null
null
null
null
null
null
null
pub struct VirInterpreterBackendCacheWrapper { cached_algorithm: backend::VirInterpreterBackend<SurchargeDecisionConfigs>, merchant_surcharge_configs: surcharge_decision_configs::MerchantSurchargeConfigs, }
crates/router/src/core/payment_methods/surcharge_decision_configs.rs
router
struct_definition
40
rust
VirInterpreterBackendCacheWrapper
null
null
null
null
null
null
null
null
null
null
null
pub fn check_client_secret_and_get_auth<T>( headers: &HeaderMap, payload: &impl ClientSecretFetch, api_auth: ApiKeyAuth, ) -> RouterResult<( Box<dyn AuthenticateAndFetch<AuthenticationData, T>>, api::AuthFlow, )> where T: SessionStateInfo + Sync + Send, ApiKeyAuth: AuthenticateAndFetch<Authe...
crates/router/src/services/authentication.rs
router
function_signature
263
rust
null
null
null
null
check_client_secret_and_get_auth
null
null
null
null
null
null
null
pub fn get_payment_method(&self) -> Option<common_enums::PaymentMethod> { Some(self.payment_method_type) }
crates/common_types/src/payment_methods.rs
common_types
function_signature
28
rust
null
null
null
null
get_payment_method
null
null
null
null
null
null
null
pub async fn tokenize_card_flow( state: &routes::SessionState, req: domain::CardNetworkTokenizeRequest, merchant_context: &domain::MerchantContext, ) -> errors::RouterResult<api::CardNetworkTokenizeResponse> { match req.data { domain::TokenizeDataRequest::Card(ref card_req) => { let ...
crates/router/src/core/payment_methods/cards.rs
router
function_signature
249
rust
null
null
null
null
tokenize_card_flow
null
null
null
null
null
null
null
impl api::ConnectorAccessToken for Coinbase {}
crates/hyperswitch_connectors/src/connectors/coinbase.rs
hyperswitch_connectors
impl_block
8
rust
null
Coinbase
api::ConnectorAccessToken for
impl api::ConnectorAccessToken for for Coinbase
null
null
null
null
null
null
null
null
pub async fn connector_update() {}
crates/openapi/src/routes/merchant_connector_account.rs
openapi
function_signature
7
rust
null
null
null
null
connector_update
null
null
null
null
null
null
null
.await } #[cfg(all(feature = "olap", feature = "v1", feature = "dynamic_routing"))] #[instrument(skip_all)] pub async fn toggle_success_based_routing( state: web::Data<AppState>, req: HttpRequest, query: web::Query<api_models::routing::ToggleDynamicRoutingQuery>, path: web::Path<routing_types::Togg...
crates/router/src/routes/routing.rs#chunk1
router
chunk
4,619
null
null
null
null
null
null
null
null
null
null
null
null
null
pub async fn merchant_account_delete( state: SessionState, merchant_id: id_type::MerchantId, ) -> RouterResponse<api::MerchantAccountDeleteResponse> { let mut is_deleted = false; let db = state.store.as_ref(); let key_manager_state = &(&state).into(); let merchant_key_store = db .get_mer...
crates/router/src/core/admin.rs
router
function_signature
513
rust
null
null
null
null
merchant_account_delete
null
null
null
null
null
null
null
pub struct BacsBankTransferAdditionalData { /// Partially masked sort code for Bacs payment method #[schema(value_type = String, example = "108800")] pub bank_sort_code: MaskedSortCode, /// Bank account's owner name #[schema(value_type = String, example = "0001****3456")] pub bank_account_numbe...
crates/common_utils/src/payout_method_utils.rs
common_utils
struct_definition
189
rust
BacsBankTransferAdditionalData
null
null
null
null
null
null
null
null
null
null
null
pub struct GenericLinkFormData { pub js_data: String, pub css_data: String, pub sdk_url: url::Url, pub html_meta_tags: String, }
crates/hyperswitch_domain_models/src/api.rs
hyperswitch_domain_models
struct_definition
38
rust
GenericLinkFormData
null
null
null
null
null
null
null
null
null
null
null
pub struct FrmMetricsBucketResponse { #[serde(flatten)] pub values: FrmMetricsBucketValue, #[serde(flatten)] pub dimensions: FrmMetricsBucketIdentifier, }
crates/api_models/src/analytics/frm.rs
api_models
struct_definition
38
rust
FrmMetricsBucketResponse
null
null
null
null
null
null
null
null
null
null
null
pub struct TimelinePayment { pub value: OverpaymentAbsoluteThreshold, pub network: String, pub transaction_id: String, }
crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs
hyperswitch_connectors
struct_definition
28
rust
TimelinePayment
null
null
null
null
null
null
null
null
null
null
null
impl common_utils::events::ApiEventMetric for EphemeralKeyCreateRequest { fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> { Some(common_utils::events::ApiEventsType::Miscellaneous) } }
crates/api_models/src/ephemeral_key.rs
api_models
impl_block
56
rust
null
EphemeralKeyCreateRequest
common_utils::events::ApiEventMetric for
impl common_utils::events::ApiEventMetric for for EphemeralKeyCreateRequest
null
null
null
null
null
null
null
null
pub async fn read_from_stream( &self, stream_name: &str, max_read_count: u64, ) -> errors::DrainerResult<StreamReadResult> { // "0-0" id gives first entry let stream_id = "0-0"; let (output, execution_time) = common_utils::date_time::time_it(|| async { sel...
crates/drainer/src/stream.rs
drainer
function_signature
162
rust
null
null
null
null
read_from_stream
null
null
null
null
null
null
null
File: crates/analytics/src/payments/metrics/debit_routing.rs use std::collections::HashSet; use api_models::analytics::{ payments::{PaymentDimensions, PaymentFilters, PaymentMetricsBucketIdentifier}, Granularity, TimeRange, }; use common_utils::errors::ReportSwitchExt; use diesel_models::enums as storage_enum...
crates/analytics/src/payments/metrics/debit_routing.rs
analytics
full_file
1,053
null
null
null
null
null
null
null
null
null
null
null
null
null
pub struct ClientAuthCheckInfoResponse { id: String, client_reference_information: ClientReferenceInformation, consumer_authentication_information: CybersourceConsumerAuthInformationEnrollmentResponse, status: CybersourceAuthEnrollmentStatus, error_information: Option<CybersourceErrorInformation>, }
crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
hyperswitch_connectors
struct_definition
61
rust
ClientAuthCheckInfoResponse
null
null
null
null
null
null
null
null
null
null
null
pub fn validate_connectors_in_routing_config(&self) -> RouterResult<()> { match self.routing_algorithm { routing_types::StaticRoutingAlgorithm::Single(choice) => { self.connector_choice(choice)?; } routing_types::StaticRoutingAlgorithm::Priority(list) => { ...
crates/router/src/core/routing/helpers.rs
router
function_signature
293
rust
null
null
null
null
validate_connectors_in_routing_config
null
null
null
null
null
null
null
pub struct PlaidRecipientCreateAddress { pub street: String, pub city: String, pub postal_code: String, pub country: String, }
crates/pm_auth/src/connector/plaid/transformers.rs
pm_auth
struct_definition
34
rust
PlaidRecipientCreateAddress
null
null
null
null
null
null
null
null
null
null
null
pub struct AtomeData { atome: AtomeDetails, #[serde(rename = "type")] payment_method_type: AirwallexPaymentType, }
crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs
hyperswitch_connectors
struct_definition
34
rust
AtomeData
null
null
null
null
null
null
null
null
null
null
null
pub struct Role { pub role_name: String, pub role_id: String, pub merchant_id: Option<id_type::MerchantId>, pub org_id: id_type::OrganizationId, #[diesel(deserialize_as = super::DieselArray<enums::PermissionGroup>)] pub groups: Vec<enums::PermissionGroup>, pub scope: enums::RoleScope, pu...
crates/diesel_models/src/role.rs
diesel_models
struct_definition
148
rust
Role
null
null
null
null
null
null
null
null
null
null
null
pub struct RuleMigrationResponse { pub profile_id: common_utils::id_type::ProfileId, pub euclid_algorithm_id: common_utils::id_type::RoutingId, pub decision_engine_algorithm_id: String, pub is_active_rule: bool, }
crates/api_models/src/routing.rs
api_models
struct_definition
54
rust
RuleMigrationResponse
null
null
null
null
null
null
null
null
null
null
null
/// Middleware to include request ID in response header. pub struct RequestId;
crates/router/src/middleware.rs
router
struct_definition
15
rust
RequestId
null
null
null
null
null
null
null
null
null
null
null
impl api::RefundSync for Gocardless {}
crates/hyperswitch_connectors/src/connectors/gocardless.rs
hyperswitch_connectors
impl_block
11
rust
null
Gocardless
api::RefundSync for
impl api::RefundSync for for Gocardless
null
null
null
null
null
null
null
null
impl api::PaymentAuthorize for Checkbook {}
crates/hyperswitch_connectors/src/connectors/checkbook.rs
hyperswitch_connectors
impl_block
9
rust
null
Checkbook
api::PaymentAuthorize for
impl api::PaymentAuthorize for for Checkbook
null
null
null
null
null
null
null
null
impl ConnectorTransactionId for Nexinets { #[cfg(feature = "v1")] fn connector_transaction_id( &self, payment_attempt: &PaymentAttempt, ) -> Result<Option<String>, ApiErrorResponse> { let metadata = Self::connector_transaction_id(self, payment_attempt.connector_metadata.a...
crates/hyperswitch_connectors/src/connectors/nexinets.rs
hyperswitch_connectors
impl_block
189
rust
null
Nexinets
ConnectorTransactionId for
impl ConnectorTransactionId for for Nexinets
null
null
null
null
null
null
null
null
pub fn validate(&self) -> Result<(), ApplicationError> { use common_utils::fp_utils::when; when(self.expiry == 0, || { Err(ApplicationError::InvalidConfigurationValueError( "link's expiry should not be 0".into(), )) }) }
crates/router/src/configs/validations.rs
router
function_signature
63
rust
null
null
null
null
validate
null
null
null
null
null
null
null
Documentation: api-reference/v2/merchant-account/merchant-account--retrieve.mdx # Type: Doc File --- openapi: get /v2/merchant-accounts/{id} ---
api-reference/v2/merchant-account/merchant-account--retrieve.mdx
null
doc_file
39
doc
null
null
null
null
null
null
null
null
null
null
null
null
pub async fn client_secret_delete( state: web::Data<AppState>, req: HttpRequest, path: web::Path<String>, ) -> HttpResponse { let flow = Flow::EphemeralKeyDelete; let payload = path.into_inner(); Box::pin(api::server_wrap( flow, state, &req, payload, |stat...
crates/router/src/routes/ephemeral_key.rs
router
function_signature
141
rust
null
null
null
null
client_secret_delete
null
null
null
null
null
null
null
File: crates/hyperswitch_interfaces/src/webhooks.rs Public structs: 1 //! Webhooks interface use common_utils::{crypto, errors::CustomResult, ext_traits::ValueExt}; use error_stack::ResultExt; use hyperswitch_domain_models::{ api::ApplicationResponse, errors::api_error_response::ApiErrorResponse, }; use masking:...
crates/hyperswitch_interfaces/src/webhooks.rs
hyperswitch_interfaces
full_file
2,443
null
null
null
null
null
null
null
null
null
null
null
null
null
impl RecoveryCodes { pub fn generate_new() -> Self { let mut rand = rand::thread_rng(); let recovery_codes = (0..consts::user::RECOVERY_CODES_COUNT) .map(|_| { let code_part_1 = Alphanumeric.sample_string(&mut rand, consts::user::RECOVERY_CODE_LENGTH /...
crates/router/src/types/domain/user.rs
router
impl_block
212
rust
null
RecoveryCodes
null
impl RecoveryCodes
null
null
null
null
null
null
null
null
pub async fn construct_relay_refund_router_data<F>( state: &SessionState, merchant_id: &id_type::MerchantId, connector_account: &domain::MerchantConnectorAccount, relay_record: &hyperswitch_domain_models::relay::Relay, ) -> RouterResult<types::RefundsRouterData<F>> { let connector_auth_type = connec...
crates/router/src/core/relay/utils.rs
router
function_signature
1,120
rust
null
null
null
null
construct_relay_refund_router_data
null
null
null
null
null
null
null
pub struct CardMandateRequest { billing_address: Option<Address>, expiry: Option<Secret<String>>, name: Option<Secret<String>>, number: Option<cards::CardNumber>, }
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
hyperswitch_connectors
struct_definition
42
rust
CardMandateRequest
null
null
null
null
null
null
null
null
null
null
null
pub struct ZenGeneralPaymentData { #[serde(rename = "type")] payment_type: ZenPaymentTypes, return_url: String, }
crates/hyperswitch_connectors/src/connectors/zen/transformers.rs
hyperswitch_connectors
struct_definition
30
rust
ZenGeneralPaymentData
null
null
null
null
null
null
null
null
null
null
null
pub struct PostSessionTokens;
crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
hyperswitch_domain_models
struct_definition
6
rust
PostSessionTokens
null
null
null
null
null
null
null
null
null
null
null
OpenAPI Block Path: components.schemas.CryptoData { "type": "object", "properties": { "pay_currency": { "type": "string", "nullable": true }, "network": { "type": "string", "nullable": true } } }
./hyperswitch/api-reference/v1/openapi_spec_v1.json
null
openapi_block
69
.json
null
null
null
null
null
openapi_spec
components
[ "schemas", "CryptoData" ]
null
null
null
null
OpenAPI Block Path: components.schemas.MobilePaymentData { "oneOf": [ { "type": "object", "required": [ "direct_carrier_billing" ], "properties": { "direct_carrier_billing": { "type": "object", "required": [ "msisdn" ], "p...
./hyperswitch/api-reference/v1/openapi_spec_v1.json
null
openapi_block
187
.json
null
null
null
null
null
openapi_spec
components
[ "schemas", "MobilePaymentData" ]
null
null
null
null
pub struct Shipping { pub address: StripeAddressDetails, pub name: Option<masking::Secret<String>>, pub carrier: Option<String>, pub phone: Option<masking::Secret<String>>, pub tracking_number: Option<masking::Secret<String>>, }
crates/router/src/compatibility/stripe/customers/types.rs
router
struct_definition
57
rust
Shipping
null
null
null
null
null
null
null
null
null
null
null
pub fn apply_changeset(self, source: MerchantAccount) -> MerchantAccount { let Self { merchant_name, merchant_details, return_url, webhook_details, sub_merchants_enabled, parent_merchant_id, enable_payment_response_hash, ...
crates/diesel_models/src/merchant_account.rs
diesel_models
function_signature
603
rust
null
null
null
null
apply_changeset
null
null
null
null
null
null
null
impl LockerMockUpNew { pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<LockerMockUp> { generics::generic_insert(conn, self).await } }
crates/diesel_models/src/query/locker_mock_up.rs
diesel_models
impl_block
44
rust
null
LockerMockUpNew
null
impl LockerMockUpNew
null
null
null
null
null
null
null
null
File: crates/api_models/src/payments/trait_impls.rs #[cfg(feature = "v1")] use common_enums::enums; #[cfg(feature = "v1")] use common_utils::errors; #[cfg(feature = "v1")] use crate::payments; #[cfg(feature = "v1")] impl crate::ValidateFieldAndGet<payments::PaymentsRequest> for common_types::primitive_wrappers::...
crates/api_models/src/payments/trait_impls.rs
api_models
full_file
247
null
null
null
null
null
null
null
null
null
null
null
null
null
impl PaymentMethodsState { pub async fn find_payment_method( &self, key_store: &merchant_key_store::MerchantKeyStore, merchant_account: &merchant_account::MerchantAccount, payment_method_id: String, ) -> CustomResult<pm_domain::PaymentMethod, errors::StorageError> { let d...
crates/payment_methods/src/state.rs
payment_methods
impl_block
204
rust
null
PaymentMethodsState
null
impl PaymentMethodsState
null
null
null
null
null
null
null
null
impl ConnectorValidation for Payone {}
crates/hyperswitch_connectors/src/connectors/payone.rs
hyperswitch_connectors
impl_block
7
rust
null
Payone
ConnectorValidation for
impl ConnectorValidation for for Payone
null
null
null
null
null
null
null
null
pub fn apply_debit_routing_decision<F, D>(&self, payment_data: &mut D)
crates/router/src/core/routing/helpers.rs
router
function_signature
20
rust
null
null
null
null
apply_debit_routing_decision
null
null
null
null
null
null
null
File: crates/router/src/services/authorization/roles.rs Public functions: 15 Public structs: 1 #[cfg(feature = "recon")] use std::collections::HashMap; use std::collections::HashSet; #[cfg(feature = "recon")] use api_models::enums::ReconPermissionScope; use common_enums::{EntityType, PermissionGroup, Resource, Role...
crates/router/src/services/authorization/roles.rs
router
full_file
1,236
null
null
null
null
null
null
null
null
null
null
null
null
null
impl common_utils::events::ApiEventMetric for TokenDataResponse {}
crates/api_models/src/payment_methods.rs
api_models
impl_block
14
rust
null
TokenDataResponse
common_utils::events::ApiEventMetric for
impl common_utils::events::ApiEventMetric for for TokenDataResponse
null
null
null
null
null
null
null
null
File: crates/router/src/db/user_key_store.rs use common_utils::{ errors::CustomResult, types::keymanager::{self, KeyManagerState}, }; use error_stack::{report, ResultExt}; use masking::Secret; use router_env::{instrument, tracing}; use storage_impl::MockDb; use crate::{ connection, core::errors, s...
crates/router/src/db/user_key_store.rs
router
full_file
1,434
null
null
null
null
null
null
null
null
null
null
null
null
null
pub struct DeutschebankReversalRequest { kind: DeutschebankTransactionKind, }
crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
hyperswitch_connectors
struct_definition
18
rust
DeutschebankReversalRequest
null
null
null
null
null
null
null
null
null
null
null
impl EuclidParsable for DummyOutput { fn parse_output(input: &str) -> ParseResult<&str, Self> { let string_w = sequence::delimited( skip_ws(complete::tag("\"")), complete::take_while(|c| c != '"'), skip_ws(complete::tag("\"")), ); let full_sequence = multi...
crates/euclid/src/frontend/ast/parser.rs
euclid
impl_block
260
rust
null
DummyOutput
EuclidParsable for
impl EuclidParsable for for DummyOutput
null
null
null
null
null
null
null
null
pub async fn refund_retrieve_core( state: SessionState, merchant_context: domain::MerchantContext, profile_id: Option<id_type::ProfileId>, request: refunds::RefundsRetrieveRequest, refund: diesel_refund::Refund, ) -> errors::RouterResult<diesel_refund::Refund> { let db = &*state.store; let ...
crates/router/src/core/refunds_v2.rs
router
function_signature
599
rust
null
null
null
null
refund_retrieve_core
null
null
null
null
null
null
null
pub async fn update(self, conn: &PgPooledConn, refund: RefundUpdate) -> StorageResult<Self> { match generics::generic_update_with_unique_predicate_get_result::< <Self as HasTable>::Table, _, _, _, >( conn, dsl::refund_id ...
crates/diesel_models/src/query/refund.rs
diesel_models
function_signature
155
rust
null
null
null
null
update
null
null
null
null
null
null
null
impl ConnectorInfo { pub fn new(gateway_name: String, gateway_id: Option<String>) -> Self { Self { gateway_name, gateway_id, } } }
crates/router/src/core/payments/routing/utils.rs
router
impl_block
39
rust
null
ConnectorInfo
null
impl ConnectorInfo
null
null
null
null
null
null
null
null
impl StorageInterface for KafkaStore { fn get_scheduler_db(&self) -> Box<dyn SchedulerInterface> { Box::new(self.clone()) } fn get_payment_methods_store(&self) -> Box<dyn PaymentMethodsStorageInterface> { Box::new(self.clone()) } fn get_cache_store(&self) -> Box<(dyn RedisConnInter...
crates/router/src/db/kafka_store.rs
router
impl_block
92
rust
null
KafkaStore
StorageInterface for
impl StorageInterface for for KafkaStore
null
null
null
null
null
null
null
null
impl api::PaymentCapture for Bluecode {}
crates/hyperswitch_connectors/src/connectors/bluecode.rs
hyperswitch_connectors
impl_block
9
rust
null
Bluecode
api::PaymentCapture for
impl api::PaymentCapture for for Bluecode
null
null
null
null
null
null
null
null
pub struct DeutschebankRouterData<T> { pub amount: MinorUnit, pub router_data: T, }
crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
hyperswitch_connectors
struct_definition
24
rust
DeutschebankRouterData
null
null
null
null
null
null
null
null
null
null
null
pub fn payments_create_request_validation( req: &api::PaymentsRequest, ) -> RouterResult<(api::Amount, enums::Currency)> { let currency = req.currency.get_required_value("currency")?; let amount = req.amount.get_required_value("amount")?; Ok((amount, currency)) }
crates/router/src/core/payments/operations/payment_create.rs
router
function_signature
64
rust
null
null
null
null
payments_create_request_validation
null
null
null
null
null
null
null
pub fn skip_ws<'a, F, O>(inner: F) -> impl FnMut(&'a str) -> ParseResult<&'a str, O> where F: FnMut(&'a str) -> ParseResult<&'a str, O> + 'a, { sequence::preceded(pchar::multispace0, inner) }
crates/euclid/src/frontend/ast/parser.rs
euclid
function_signature
77
rust
null
null
null
null
skip_ws
null
null
null
null
null
null
null
impl PaymentSync for Threedsecureio {}
crates/hyperswitch_connectors/src/connectors/threedsecureio.rs
hyperswitch_connectors
impl_block
9
rust
null
Threedsecureio
PaymentSync for
impl PaymentSync for for Threedsecureio
null
null
null
null
null
null
null
null
Documentation: api-reference/v2/payment-methods/payment-method--list-customer-saved-payment-methods.mdx # Type: Doc File --- openapi: get /v2/customers/{id}/saved-payment-methods ---
api-reference/v2/payment-methods/payment-method--list-customer-saved-payment-methods.mdx
null
doc_file
48
doc
null
null
null
null
null
null
null
null
null
null
null
null
Documentation: api-reference/introduction.mdx # Type: Doc File --- tags: "Getting Started" title: "👋 Welcome to Hyperswitch API Reference" sidebarTitle: "Introduction" stoplight-id: "3lmsk7ocvq21v" icon: "rectangle-code" iconType: "solid" --- Hyperswitch provides a collection of APIs that enable you to process and m...
api-reference/introduction.mdx
null
doc_file
1,423
doc
null
null
null
null
null
null
null
null
null
null
null
null
pub struct RoutableConnectors(Vec<routing_types::RoutableConnectorChoice>);
crates/router/src/core/routing.rs
router
struct_definition
18
rust
RoutableConnectors
null
null
null
null
null
null
null
null
null
null
null
impl Responder { use hyperswitch_domain_models::payments::PaymentStatusData; let flow = match payload.force_sync { true => Flow::PaymentsRetrieveForceSync, false => Flow::PaymentsRetrieve, }; tracing::Span::current().record("flow", flow.to_string()); let global_payment_id = path.in...
crates/router/src/routes/payments.rs
router
impl_block
519
rust
null
Responder
null
impl Responder
null
null
null
null
null
null
null
null
pub async fn api_key_create( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<api_types::CreateApiKeyRequest>, ) -> impl Responder { let flow = Flow::ApiKeyCreate; let payload = json_payload.into_inner(); Box::pin(api::server_wrap( flow, state, &req,...
crates/router/src/routes/api_keys.rs
router
function_signature
187
rust
null
null
null
null
api_key_create
null
null
null
null
null
null
null
pub fn server(state: AppState) -> Scope { web::scope("/files") .app_data(web::Data::new(state)) .service(web::resource("").route(web::post().to(files::files_create))) .service( web::resource("/{file_id}") .route(web::delete().to(files::file...
crates/router/src/routes/app.rs
router
function_signature
89
rust
null
null
null
null
server
null
null
null
null
null
null
null
pub trait SdkEventMetricAnalytics: LoadRow<SdkEventMetricRow> {}
crates/analytics/src/sdk_events/metrics.rs
analytics
trait_definition
17
rust
null
null
SdkEventMetricAnalytics
null
null
null
null
null
null
null
null
null
pub async fn get_total_saved_payment_methods_for_merchant( state: SessionState, merchant_context: domain::MerchantContext, ) -> RouterResponse<api::TotalPaymentMethodCountResponse> { let total_payment_method_count = get_total_payment_method_count_core(&state, &merchant_context).await?; Ok(hyper...
crates/router/src/core/payment_methods.rs
router
function_signature
89
rust
null
null
null
null
get_total_saved_payment_methods_for_merchant
null
null
null
null
null
null
null
/// Trait defining the states of a secret pub trait SecretState {}
crates/hyperswitch_interfaces/src/secrets_interface/secret_state.rs
hyperswitch_interfaces
trait_definition
14
rust
null
null
SecretState
null
null
null
null
null
null
null
null
null
impl api::MandateSetup for Mollie {}
crates/hyperswitch_connectors/src/connectors/mollie.rs
hyperswitch_connectors
impl_block
12
rust
null
Mollie
api::MandateSetup for
impl api::MandateSetup for for Mollie
null
null
null
null
null
null
null
null
OpenAPI Block Path: components.schemas.PaymentsSessionRequest { "type": "object", "required": [ "payment_id", "client_secret", "wallets" ], "properties": { "payment_id": { "type": "string", "description": "The identifier for the payment" }, "client_secret": { "type": "s...
./hyperswitch/api-reference/v1/openapi_spec_v1.json
null
openapi_block
212
.json
null
null
null
null
null
openapi_spec
components
[ "schemas", "PaymentsSessionRequest" ]
null
null
null
null
connectors::Bluecode, connectors::Braintree, connectors::Boku, connectors::Breadpay, connectors::Cashtocode, connectors::Celero, connectors::Chargebee, connectors::Checkbook, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, conn...
crates/hyperswitch_connectors/src/default_implementations.rs#chunk6
hyperswitch_connectors
chunk
7,915
null
null
null
null
null
null
null
null
null
null
null
null
null
impl PaymentLinkNew { pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PaymentLink> { generics::generic_insert(conn, self).await } }
crates/diesel_models/src/query/payment_link.rs
diesel_models
impl_block
42
rust
null
PaymentLinkNew
null
impl PaymentLinkNew
null
null
null
null
null
null
null
null
pub async fn get_sdk_event_metrics( &self, metric: &SdkEventMetrics, dimensions: &[SdkEventDimensions], publishable_key: &str, filters: &SdkEventFilters, granularity: Option<Granularity>, time_range: &TimeRange, ) -> types::MetricsResult<HashSet<(SdkEventMetri...
crates/analytics/src/lib.rs
analytics
function_signature
240
rust
null
null
null
null
get_sdk_event_metrics
null
null
null
null
null
null
null
pub async fn update_payment_methods( state: &SessionState, payment_methods: Vec<pm_api::UpdatePaymentMethodRecord>, merchant_id: &id_type::MerchantId, merchant_context: &merchant_context::MerchantContext, ) -> PmMigrationResult<Vec<pm_api::PaymentMethodUpdateResponse>> { let mut result = Vec::with_c...
crates/router/src/core/payment_methods/migration.rs
router
function_signature
186
rust
null
null
null
null
update_payment_methods
null
null
null
null
null
null
null
pub async fn list_profiles_for_user_in_org_and_merchant( state: web::Data<AppState>, req: HttpRequest, ) -> HttpResponse { let flow = Flow::ListProfileForUserInOrgAndMerchant; Box::pin(api::server_wrap( flow, state.clone(), &req, (), |state, user_from_token, _, _...
crates/router/src/routes/user.rs
router
function_signature
129
rust
null
null
null
null
list_profiles_for_user_in_org_and_merchant
null
null
null
null
null
null
null
pub async fn find_by_merchant_id_payment_id_address_id( conn: &PgPooledConn, merchant_id: &common_utils::id_type::MerchantId, payment_id: &common_utils::id_type::PaymentId, address_id: &str, ) -> StorageResult<Self> { match generics::generic_find_one::<<Self as HasTable>::Tab...
crates/diesel_models/src/query/address.rs
diesel_models
function_signature
212
rust
null
null
null
null
find_by_merchant_id_payment_id_address_id
null
null
null
null
null
null
null
pub fn get_recovery_codes(&self) -> Option<Vec<Secret<String>>> { self.0.totp_recovery_codes.clone() }
crates/router/src/types/domain/user.rs
router
function_signature
28
rust
null
null
null
null
get_recovery_codes
null
null
null
null
null
null
null
pub fn get_error_response( error_data: &Option<WellsfargoErrorInformation>, risk_information: &Option<ClientRiskInformation>, attempt_status: Option<enums::AttemptStatus>, status_code: u16, transaction_id: String, ) -> ErrorResponse { let avs_message = risk_information .clone() ....
crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
hyperswitch_connectors
function_signature
406
rust
null
null
null
null
get_error_response
null
null
null
null
null
null
null
pub struct Shift4CardToken { pub id: Secret<String>, }
crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs
hyperswitch_connectors
struct_definition
15
rust
Shift4CardToken
null
null
null
null
null
null
null
null
null
null
null
pub trait ForexMetric { fn is_forex_metric(&self) -> bool; }
crates/api_models/src/analytics.rs
api_models
trait_definition
18
rust
null
null
ForexMetric
null
null
null
null
null
null
null
null
null
pub struct ZslPaymentsRequest { process_type: ProcessType, process_code: ProcessCode, txn_amt: String, ccy: api_models::enums::Currency, mer_ref: String, mer_txn_date: String, mer_id: Secret<String>, lang: String, success_url: String, failure_url: String, success_s2s_url: Str...
crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs
hyperswitch_connectors
struct_definition
185
rust
ZslPaymentsRequest
null
null
null
null
null
null
null
null
null
null
null
pub struct DirectChargeRefund { pub revert_platform_fee: bool, }
crates/hyperswitch_domain_models/src/router_request_types.rs
hyperswitch_domain_models
struct_definition
16
rust
DirectChargeRefund
null
null
null
null
null
null
null
null
null
null
null
OpenAPI Block Path: components.schemas.SkrillData { "type": "object" }
./hyperswitch/api-reference/v1/openapi_spec_v1.json
null
openapi_block
22
.json
null
null
null
null
null
openapi_spec
components
[ "schemas", "SkrillData" ]
null
null
null
null
pub struct CardTransactionRequest { pub currency: api_models::enums::Currency, pub exchange_currency: api_models::enums::Currency, pub value: StringMajorUnit, pub from_credit_card: FacilitapayCardDetails, pub to_bank_account_id: Secret<String>, // UUID pub subject_id: String, // ...
crates/hyperswitch_connectors/src/connectors/facilitapay/requests.rs
hyperswitch_connectors
struct_definition
75
rust
CardTransactionRequest
null
null
null
null
null
null
null
null
null
null
null
pub async fn api_key_retrieve() {}
crates/openapi/src/routes/api_keys.rs
openapi
function_signature
9
rust
null
null
null
null
api_key_retrieve
null
null
null
null
null
null
null
pub fn get_connector_auth_type( merchant_connector_account: domain::MerchantConnectorAccount, ) -> errors::CustomResult<pm_auth_types::ConnectorAuthType, ApiErrorResponse> { let auth_type: types::ConnectorAuthType = merchant_connector_account .connector_account_details .parse_value("ConnectorAut...
crates/router/src/core/pm_auth/helpers.rs
router
function_signature
131
rust
null
null
null
null
get_connector_auth_type
null
null
null
null
null
null
null
File: crates/events/src/lib.rs Public functions: 8 Public structs: 2 #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide))] #![cfg_attr(docsrs, doc(cfg_hide(doc)))] #![warn(missing_docs)] //! A generic event handler system. //! This library consists of 4 parts: //! Event Sink: A trait that defines how events are...
crates/events/src/lib.rs
events
full_file
1,979
null
null
null
null
null
null
null
null
null
null
null
null
null
pub async fn get_refunds_aggregate_profile( state: web::Data<AppState>, req: HttpRequest, query_params: web::Query<common_utils::types::TimeRange>, ) -> HttpResponse { let flow = Flow::RefundsAggregate; let query_params = query_params.into_inner(); Box::pin(api::server_wrap( flow, ...
crates/router/src/routes/refunds.rs
router
function_signature
247
rust
null
null
null
null
get_refunds_aggregate_profile
null
null
null
null
null
null
null
pub async fn evaluate_routing_rule( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<RoutingEvaluateRequest>, ) -> impl Responder { let json_payload = json_payload.into_inner(); let flow = Flow::RoutingEvaluateRule; Box::pin(oss_api::server_wrap( flow, state,...
crates/router/src/routes/routing.rs
router
function_signature
255
rust
null
null
null
null
evaluate_routing_rule
null
null
null
null
null
null
null
( Connector::Santander, RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::new(), common: HashMap::from([ RequiredField::BillingUserFirstName.to_tu...
crates/payment_methods/src/configs/payment_connector_required_fields.rs#chunk3
payment_methods
chunk
2,124
null
null
null
null
null
null
null
null
null
null
null
null
null
pub fn set_request_body(&mut self, request: Req) { self.request = Some(request); }
crates/router/src/core/payments/routing/utils.rs
router
function_signature
23
rust
null
null
null
null
set_request_body
null
null
null
null
null
null
null
pub fn handle_unified_connector_service_response_for_payment_authorize( response: PaymentServiceAuthorizeResponse, ) -> CustomResult< ( AttemptStatus, Result<PaymentsResponseData, ErrorResponse>, u16, ), UnifiedConnectorServiceError, > { let status = AttemptStatus::foreign_tr...
crates/router/src/core/unified_connector_service.rs
router
function_signature
119
rust
null
null
null
null
handle_unified_connector_service_response_for_payment_authorize
null
null
null
null
null
null
null
pub async fn payment_external_authentication<F: Clone + Sync>( state: SessionState, merchant_context: domain::MerchantContext, req: api_models::payments::PaymentsExternalAuthenticationRequest, ) -> RouterResponse<api_models::payments::PaymentsExternalAuthenticationResponse> { use super::unified_authenti...
crates/router/src/core/payments.rs
router
function_signature
1,992
rust
null
null
null
null
payment_external_authentication
null
null
null
null
null
null
null
pub struct CheckbookAuthType { pub(super) publishable_key: Secret<String>, pub(super) secret_key: Secret<String>, }
crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs
hyperswitch_connectors
struct_definition
29
rust
CheckbookAuthType
null
null
null
null
null
null
null
null
null
null
null
impl GetRequestIncrementalAuthorization for CompleteAuthorizeData { fn get_request_incremental_authorization(&self) -> Option<bool> { None } }
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
hyperswitch_connectors
impl_block
33
rust
null
CompleteAuthorizeData
GetRequestIncrementalAuthorization for
impl GetRequestIncrementalAuthorization for for CompleteAuthorizeData
null
null
null
null
null
null
null
null
impl MerchantContext { pub fn get_merchant_account(&self) -> &MerchantAccount { match self { Self::NormalMerchant(merchant_account) => &merchant_account.0, } } pub fn get_merchant_key_store(&self) -> &MerchantKeyStore { match self { Self::NormalMerchant(merch...
crates/hyperswitch_domain_models/src/merchant_context.rs
hyperswitch_domain_models
impl_block
85
rust
null
MerchantContext
null
impl MerchantContext
null
null
null
null
null
null
null
null
pub fn add_nested_filter_clause(&mut self, filter: Filter) { match &mut self.filters { Filter::NestedFilter(_, ref mut filters) => filters.push(filter), f @ Filter::Plain(_, _, _) => { self.filters = Filter::NestedFilter(FilterCombinator::And, vec![f.clone(), filter]); ...
crates/analytics/src/query.rs
analytics
function_signature
76
rust
null
null
null
null
add_nested_filter_clause
null
null
null
null
null
null
null