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 struct PspTokenResult {
pub token: Result<String, ErrorResponse>,
} | crates/router/src/types.rs | router | struct_definition | 17 | rust | PspTokenResult | null | null | null | null | null | null | null | null | null | null | null |
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
} | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs | hyperswitch_connectors | function_signature | 28 | rust | null | null | null | null | new | null | null | null | null | null | null | null |
pub struct ConnectorChoice {
pub connector: RoutableConnectors,
} | crates/euclid/src/frontend/ast.rs | euclid | struct_definition | 15 | rust | ConnectorChoice | null | null | null | null | null | null | null | null | null | null | null |
pub struct StripeSetupIntentResponse {
pub id: id_type::PaymentId,
pub object: String,
pub status: StripeSetupStatus,
pub client_secret: Option<masking::Secret<String>>,
pub metadata: Option<Value>,
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub created: Option<time::Prim... | crates/router/src/compatibility/stripe/setup_intents/types.rs | router | struct_definition | 161 | rust | StripeSetupIntentResponse | null | null | null | null | null | null | null | null | null | null | null |
pub fn get_total_surcharge_amount(&self) -> MinorUnit {
self.surcharge_amount + self.tax_on_surcharge_amount
} | crates/hyperswitch_domain_models/src/router_request_types.rs | hyperswitch_domain_models | function_signature | 30 | rust | null | null | null | null | get_total_surcharge_amount | null | null | null | null | null | null | null |
pub async fn make_payout_data(
state: &SessionState,
merchant_context: &domain::MerchantContext,
auth_profile_id: Option<id_type::ProfileId>,
req: &payouts::PayoutRequest,
locale: &str,
) -> RouterResult<PayoutData> {
let db = &*state.store;
let merchant_id = merchant_context.get_merchant_ac... | crates/router/src/core/payouts.rs | router | function_signature | 1,564 | rust | null | null | null | null | make_payout_data | null | null | null | null | null | null | null |
pub struct Hyperwallet {
amount_converter: &'static (dyn AmountConvertor<Output = StringMinorUnit> + Sync),
} | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs | hyperswitch_connectors | struct_definition | 27 | rust | Hyperwallet | null | null | null | null | null | null | null | null | null | null | null |
impl NovalnetPaymentsResponseTransactionData {
pub fn get_token(transaction_data: Option<&Self>) -> Option<String> {
if let Some(data) = transaction_data {
match &data.payment_data {
Some(NovalnetResponsePaymentData::Card(card_data)) => {
card_data.token.clone... | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs | hyperswitch_connectors | impl_block | 129 | rust | null | NovalnetPaymentsResponseTransactionData | null | impl NovalnetPaymentsResponseTransactionData | null | null | null | null | null | null | null | null |
pub struct ErrorDetails {
/// The error code that was returned by the connector.
/// This is a mandatory field. This is used to lookup the global status map record for unified code and retries
pub code: String,
/// The error message that was returned by the connector.
/// This is a mandatory field. ... | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs | hyperswitch_domain_models | struct_definition | 362 | rust | ErrorDetails | null | null | null | null | null | null | null | null | null | null | null |
pub struct CardNetworkTokenizeRequest {
pub data: TokenizeDataRequest,
pub customer: CustomerDetails,
pub billing: Option<Address>,
pub metadata: Option<pii::SecretSerdeValue>,
pub payment_method_issuer: Option<String>,
} | crates/hyperswitch_domain_models/src/bulk_tokenization.rs | hyperswitch_domain_models | struct_definition | 55 | rust | CardNetworkTokenizeRequest | null | null | null | null | null | null | null | null | null | null | null |
pub struct GlobepayRefundRequest {
pub fee: MinorUnit,
} | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs | hyperswitch_connectors | struct_definition | 17 | rust | GlobepayRefundRequest | null | null | null | null | null | null | null | null | null | null | null |
OpenAPI Block Path: paths."/payouts/{payout_id}/cancel"
{
"post": {
"tags": [
"Payouts"
],
"summary": "Payouts - Cancel",
"operationId": "Cancel a Payout",
"parameters": [
{
"name": "payout_id",
"in": "path",
"description": "The identifier for payout",
"... | ./hyperswitch/api-reference/v1/openapi_spec_v1.json | null | openapi_block | 264 | .json | null | null | null | null | null | openapi_spec | paths | [
"/payouts/{payout_id}/cancel"
] | null | null | null | null |
pub struct VoltPaymentsWebhookBodyEventType {
pub status: VoltWebhookPaymentStatus,
pub detailed_status: Option<VoltDetailedStatus>,
} | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs | hyperswitch_connectors | struct_definition | 31 | rust | VoltPaymentsWebhookBodyEventType | null | null | null | null | null | null | null | null | null | null | null |
impl MultipleCaptureSyncResponse for GlobalpayPaymentsResponse {
fn get_connector_capture_id(&self) -> String {
self.id.clone()
}
fn get_capture_attempt_status(&self) -> common_enums::AttemptStatus {
common_enums::AttemptStatus::from(self.status)
}
fn is_capture_response(&self) -> ... | crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs | hyperswitch_connectors | impl_block | 200 | rust | null | GlobalpayPaymentsResponse | MultipleCaptureSyncResponse for | impl MultipleCaptureSyncResponse for for GlobalpayPaymentsResponse | null | null | null | null | null | null | null | null |
pub struct PaypalRedirectionResponse {
attributes: Option<AttributeResponse>,
} | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs | hyperswitch_connectors | struct_definition | 16 | rust | PaypalRedirectionResponse | null | null | null | null | null | null | null | null | null | null | null |
pub struct VaultRequestData {
pub payment_method_vaulting_data: Option<PaymentMethodVaultingData>,
pub connector_vault_id: Option<String>,
pub connector_customer_id: Option<String>,
} | crates/hyperswitch_domain_models/src/router_request_types.rs | hyperswitch_domain_models | struct_definition | 43 | rust | VaultRequestData | null | null | null | null | null | null | null | null | null | null | null |
impl api::RefundExecute for Affirm {} | crates/hyperswitch_connectors/src/connectors/affirm.rs | hyperswitch_connectors | impl_block | 10 | rust | null | Affirm | api::RefundExecute for | impl api::RefundExecute for for Affirm | null | null | null | null | null | null | null | null |
pub struct ErrorData {
pub code: String,
pub message: String,
pub reason: Option<String>,
} | crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs | hyperswitch_connectors | struct_definition | 25 | rust | ErrorData | null | null | null | null | null | null | null | null | null | null | null |
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PayoutAttempt> {
generics::generic_insert(conn, self).await
} | crates/diesel_models/src/query/payout_attempt.rs | diesel_models | function_signature | 35 | rust | null | null | null | null | insert | null | null | null | null | null | null | null |
pub struct RedsysOperationRequest {
ds_merchant_order: String,
ds_merchant_merchantcode: Secret<String>,
ds_merchant_terminal: Secret<String>,
ds_merchant_currency: String,
ds_merchant_transactiontype: RedsysTransactionType,
ds_merchant_amount: StringMinorUnit,
} | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs | hyperswitch_connectors | struct_definition | 66 | rust | RedsysOperationRequest | null | null | null | null | null | null | null | null | null | null | null |
File: crates/common_utils/src/new_type.rs
Public structs: 9
//! Contains new types with restrictions
use masking::{ExposeInterface, PeekInterface, Secret};
use crate::{
consts::MAX_ALLOWED_MERCHANT_NAME_LENGTH,
pii::{Email, UpiVpaMaskingStrategy},
transformers::ForeignFrom,
};
#[nutype::nutype(
deri... | crates/common_utils/src/new_type.rs | common_utils | full_file | 2,814 | null | null | null | null | null | null | null | null | null | null | null | null | null |
impl ConnectorValidation for Klarna {} | crates/hyperswitch_connectors/src/connectors/klarna.rs | hyperswitch_connectors | impl_block | 7 | rust | null | Klarna | ConnectorValidation for | impl ConnectorValidation for for Klarna | null | null | null | null | null | null | null | null |
impl VaultingInterface for VaultDelete {
fn get_vaulting_request_url() -> &'static str {
consts::VAULT_DELETE_REQUEST_URL
}
fn get_vaulting_flow_name() -> &'static str {
consts::VAULT_DELETE_FLOW_TYPE
}
} | crates/router/src/types/payment_methods.rs | router | impl_block | 59 | rust | null | VaultDelete | VaultingInterface for | impl VaultingInterface for for VaultDelete | null | null | null | null | null | null | null | null |
impl Bankofamerica {
pub fn generate_digest(&self, payload: &[u8]) -> String {
let payload_digest = digest::digest(&digest::SHA256, payload);
consts::BASE64_ENGINE.encode(payload_digest)
}
pub fn generate_signature(
&self,
auth: bankofamerica::BankOfAmericaAuthType,
... | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs | hyperswitch_connectors | impl_block | 445 | rust | null | Bankofamerica | null | impl Bankofamerica | null | null | null | null | null | null | null | null |
File: crates/router/src/core/payments/flows/external_proxy_flow.rs
use async_trait::async_trait;
use common_enums as enums;
use error_stack::ResultExt;
use hyperswitch_domain_models::errors::api_error_response::ApiErrorResponse;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::payments::PaymentConfirmData;
use ma... | crates/router/src/core/payments/flows/external_proxy_flow.rs | router | full_file | 2,920 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub fn parse_url_encoded_to_struct<T: DeserializeOwned>(
query_bytes: Bytes,
) -> CustomResult<T, errors::ConnectorError> {
let (cow, _, _) = encoding_rs::ISO_8859_15.decode(&query_bytes);
serde_qs::from_str::<T>(cow.as_ref()).change_context(errors::ConnectorError::ParsingFailed)
} | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs | hyperswitch_connectors | function_signature | 79 | rust | null | null | null | null | parse_url_encoded_to_struct | null | null | null | null | null | null | null |
pub struct Capture {
#[serde(rename = "type")]
cap_type: CaptureType,
reference: String,
} | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs | hyperswitch_connectors | struct_definition | 25 | rust | Capture | null | null | null | null | null | null | null | null | null | null | null |
pub struct AffirmCancelResponse {
pub id: String,
pub amount: MinorUnit,
pub created: String,
pub currency: Currency,
pub fee: Option<MinorUnit>,
pub fee_refunded: Option<MinorUnit>,
pub reference_id: Option<String>,
#[serde(rename = "type")]
pub event_type: AffirmEventType,
pub ... | crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs | hyperswitch_connectors | struct_definition | 143 | rust | AffirmCancelResponse | null | null | null | null | null | null | null | null | null | null | null |
pub struct ZslAuthType {
pub(super) api_key: Secret<String>,
pub(super) merchant_id: Secret<String>,
} | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs | hyperswitch_connectors | struct_definition | 28 | rust | ZslAuthType | null | null | null | null | null | null | null | null | null | null | null |
impl api::RefundExecute for Novalnet {} | crates/hyperswitch_connectors/src/connectors/novalnet.rs | hyperswitch_connectors | impl_block | 11 | rust | null | Novalnet | api::RefundExecute for | impl api::RefundExecute for for Novalnet | null | null | null | null | null | null | null | null |
/// Extract customer_id from payment intent feature metadata
pub fn extract_connector_customer_id_from_payment_intent(
&self,
) -> Result<String, common_utils::errors::ValidationError> {
self.feature_metadata
.as_ref()
.and_then(|metadata| metadata.payment_revenue_recover... | crates/hyperswitch_domain_models/src/payments.rs | hyperswitch_domain_models | function_signature | 130 | rust | null | null | null | null | extract_connector_customer_id_from_payment_intent | null | null | null | null | null | null | null |
impl api::PaymentSync for Nexixpay {} | crates/hyperswitch_connectors/src/connectors/nexixpay.rs | hyperswitch_connectors | impl_block | 10 | rust | null | Nexixpay | api::PaymentSync for | impl api::PaymentSync for for Nexixpay | null | null | null | null | null | null | null | null |
File: crates/common_utils/src/types/keymanager.rs
Public functions: 3
Public structs: 18
#![allow(missing_docs)]
use core::fmt;
use base64::Engine;
use masking::{ExposeInterface, PeekInterface, Secret, Strategy, StrongSecret};
#[cfg(feature = "encryption_service")]
use router_env::logger;
#[cfg(feature = "km_forwa... | crates/common_utils/src/types/keymanager.rs | common_utils | full_file | 3,667 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct PlaidSyncRequest {
payment_id: String,
} | crates/hyperswitch_connectors/src/connectors/plaid/transformers.rs | hyperswitch_connectors | struct_definition | 14 | rust | PlaidSyncRequest | null | null | null | null | null | null | null | null | null | null | null |
File: crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs
use std::collections::HashSet;
use api_models::analytics::{
sdk_events::{
SdkEventDimensions, SdkEventFilters, SdkEventMetricsBucketIdentifier, SdkEventNames,
},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt... | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs | analytics | full_file | 800 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct RoutingEvaluateRequest {
pub created_by: String,
#[schema(value_type = Object)]
///Parameters that can be used in the routing evaluate request.
///eg: {"parameters": {
/// "payment_method": {"type": "enum_variant", "value": "card"},
/// "payment_method_type": {"type": "enum_vari... | crates/api_models/src/routing.rs | api_models | struct_definition | 422 | rust | RoutingEvaluateRequest | null | null | null | null | null | null | null | null | null | null | null |
File: crates/openapi/src/openapi.rs
use crate::routes;
#[derive(utoipa::OpenApi)]
#[openapi(
info(
title = "Hyperswitch - API Documentation",
contact(
name = "Hyperswitch Support",
url = "https://hyperswitch.io",
email = "hyperswitch@juspay.in"
),
... | crates/openapi/src/openapi.rs#chunk0 | openapi | chunk | 8,188 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub async fn get_merchant_auth_events_filters(
state: web::Data<AppState>,
req: actix_web::HttpRequest,
json_payload: web::Json<GetAuthEventFilterRequest>,
) -> impl Responder {
let flow = AnalyticsFlow::GetAuthEventFilters;
Box::pin(api::server_wrap(
flow,
... | crates/router/src/analytics.rs | router | function_signature | 228 | rust | null | null | null | null | get_merchant_auth_events_filters | null | null | null | null | null | null | null |
pub fn is_sso_auth_type(auth_type: UserAuthType) -> bool {
match auth_type {
UserAuthType::OpenIdConnect => true,
UserAuthType::Password | UserAuthType::MagicLink => false,
}
} | crates/router/src/utils/user.rs | router | function_signature | 52 | rust | null | null | null | null | is_sso_auth_type | null | null | null | null | null | null | null |
Documentation: crates/drainer/README.md
# Type: Doc File
# Drainer
Application that reads Redis streams and executes queries in database.
| crates/drainer/README.md | null | doc_file | 30 | doc | null | null | null | null | null | null | null | null | null | null | null | null |
impl Stop for ServerHandle {
async fn stop_server(&mut self) {
let _ = self.stop(true).await;
}
} | crates/router/src/lib.rs | router | impl_block | 29 | rust | null | ServerHandle | Stop for | impl Stop for for ServerHandle | null | null | null | null | null | null | null | null |
File: crates/router_env/src/vergen.rs
Public functions: 2
/// Configures the [`vergen`][::vergen] crate to generate the `cargo` build instructions.
///
/// This function should be typically called within build scripts to generate `cargo` build
/// instructions for the corresponding crate.
///
/// # Panics
///
/// Pan... | crates/router_env/src/vergen.rs | router_env | full_file | 289 | null | null | null | null | null | null | null | null | null | null | null | null | null |
Web Documentation: Alternate Payment Method Widgets | Hyperswitch
# Type: Web Doc
We support modular, embeddable alternate payment methods (APMs) known as
Hyperwidgets
, which a merchant can use to augment their existing checkout in a low code manner.
Let us understand with an example-
In the below checkout screen the... | https://docs.hyperswitch.io/about-hyperswitch/payments-modules/enable-alternate-payment-method-widgets | null | web_doc_file | 1,196 | doc | null | null | null | null | null | web | null | null | null | https://docs.hyperswitch.io/about-hyperswitch/payments-modules/enable-alternate-payment-method-widgets | Alternate Payment Method Widgets | Hyperswitch | null |
impl ConnectorSpecifications for Authorizedotnet {
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
Some(&AUTHORIZEDOTNET_CONNECTOR_INFO)
}
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
Some(&*AUTHORIZEDOTNET_SUPPORTED_PAYMENT_METHODS... | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs | hyperswitch_connectors | impl_block | 109 | rust | null | Authorizedotnet | ConnectorSpecifications for | impl ConnectorSpecifications for for Authorizedotnet | null | null | null | null | null | null | null | null |
pub async fn get_event_handler(&self) -> StorageResult<EventsHandler> {
Ok(match self {
Self::Kafka { kafka } => EventsHandler::Kafka(
KafkaProducer::create(kafka)
.await
.change_context(StorageError::InitializationError)?,
),
... | crates/router/src/events.rs | router | function_signature | 84 | rust | null | null | null | null | get_event_handler | null | null | null | null | null | null | null |
pub struct PaystackPaymentWebhookData {
pub status: PaystackPSyncStatus,
pub reference: String,
} | crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs | hyperswitch_connectors | struct_definition | 26 | rust | PaystackPaymentWebhookData | null | null | null | null | null | null | null | null | null | null | null |
File: crates/router/src/utils/user/dashboard_metadata.rs
Public functions: 13
use std::{net::IpAddr, ops::Not, str::FromStr};
use actix_web::http::header::HeaderMap;
use api_models::user::dashboard_metadata::{
GetMetaDataRequest, GetMultipleMetaDataPayload, ProdIntent, SetMetaDataRequest,
};
use common_utils::id... | crates/router/src/utils/user/dashboard_metadata.rs | router | full_file | 2,329 | null | null | null | null | null | null | null | null | null | null | null | null | null |
//Note: we might have to call retrieve_setup_intent to get the network_transaction_id in case its not sent in PaymentIntentResponse
// Or we identify the mandate txns before hand and always call SetupIntent in case of mandate payment call
let network_txn_id = match item.response.latest_charge.as... | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs#chunk3 | hyperswitch_connectors | chunk | 8,171 | null | null | null | null | null | null | null | null | null | null | null | null | null |
Documentation: docs/CONTRIBUTING.md
# Type: Doc File
# Contributing to hyperswitch
:tada: First off, thanks for taking the time to contribute!
We are so happy to have you! :tada:
There are opportunities to contribute to hyperswitch at any level.
It doesn't matter if you are just getting started with Rust or are the ... | docs/CONTRIBUTING.md | null | doc_file | 6,421 | doc | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct KakaoPayRedirection {} | crates/hyperswitch_domain_models/src/payment_method_data.rs | hyperswitch_domain_models | struct_definition | 8 | rust | KakaoPayRedirection | null | null | null | null | null | null | null | null | null | null | null |
pub fn get_resources_set(&self) -> HashSet<Resource> {
self.get_permission_groups()
.iter()
.flat_map(|group| group.resources())
.collect()
} | crates/router/src/services/authorization/roles.rs | router | function_signature | 39 | rust | null | null | null | null | get_resources_set | null | null | null | null | null | null | null |
impl BlocklistLookup {
pub async fn find_by_merchant_id_fingerprint(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
fingerprint: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
ds... | crates/diesel_models/src/query/blocklist_lookup.rs | diesel_models | impl_block | 224 | rust | null | BlocklistLookup | null | impl BlocklistLookup | null | null | null | null | null | null | null | null |
pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo {
MerchantConnectorInfo {
connector_label: connector_label.to_string(),
merchant_connector_id: self.id.clone(),
}
} | crates/api_models/src/admin.rs | api_models | function_signature | 48 | rust | null | null | null | null | to_merchant_connector_info | null | null | null | null | null | null | null |
pub struct DwollaAuthType {
pub(super) client_id: Secret<String>,
pub(super) client_secret: Secret<String>,
} | crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs | hyperswitch_connectors | struct_definition | 28 | rust | DwollaAuthType | null | null | null | null | null | null | null | null | null | null | null |
File: crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs
use std::collections::HashSet;
use api_models::analytics::{
refunds::{RefundDimensions, RefundFilters, RefundMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use error_stack::Re... | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs | analytics | full_file | 865 | null | null | null | null | null | null | null | null | null | null | null | null | null |
File: crates/masking/src/maskable.rs
Public functions: 5
//! This module contains Masking objects and traits
use crate::{ExposeInterface, Secret};
/// An Enum that allows us to optionally mask data, based on which enum variant that data is stored
/// in.
#[derive(Clone, Eq, PartialEq)]
pub enum Maskable<T: Eq + Par... | crates/masking/src/maskable.rs | masking | full_file | 796 | null | null | null | null | null | null | null | null | null | null | null | null | null |
impl Cashtocode {
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
} | crates/hyperswitch_connectors/src/connectors/cashtocode.rs | hyperswitch_connectors | impl_block | 35 | rust | null | Cashtocode | null | impl Cashtocode | null | null | null | null | null | null | null | null |
pub async fn connect_account(
state: SessionState,
request: user_api::ConnectAccountRequest,
auth_id: Option<String>,
theme_id: Option<String>,
) -> UserResponse<user_api::ConnectAccountResponse> {
let user_email = domain::UserEmail::from_pii_email(request.email.clone())?;
utils::user::validate... | crates/router/src/core/user.rs | router | function_signature | 957 | rust | null | null | null | null | connect_account | null | null | null | null | null | null | null |
pub struct NexinetsErrorResponse {
pub status: u16,
pub code: u16,
pub message: String,
pub errors: Vec<OrderErrorDetails>,
} | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs | hyperswitch_connectors | struct_definition | 39 | rust | NexinetsErrorResponse | null | null | null | null | null | null | null | null | null | null | null |
pub struct OrderLines {
name: String,
quantity: u16,
unit_price: MinorUnit,
total_amount: MinorUnit,
total_tax_amount: Option<MinorUnit>,
tax_rate: Option<f64>,
} | crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs | hyperswitch_connectors | struct_definition | 51 | rust | OrderLines | null | null | null | null | null | null | null | null | null | null | null |
pub async fn proxy_confirm_intent(
state: web::Data<app::AppState>,
req: actix_web::HttpRequest,
json_payload: web::Json<api_models::payments::ProxyPaymentsRequest>,
path: web::Path<common_utils::id_type::GlobalPaymentId>,
) -> impl Responder {
use hyperswitch_domain_models::payments::PaymentConfirm... | crates/router/src/routes/payments.rs | router | function_signature | 496 | rust | null | null | null | null | proxy_confirm_intent | null | null | null | null | null | null | null |
pub async fn log_refund(
&self,
refund: &Refund,
old_refund: Option<Refund>,
tenant_id: TenantID,
) -> MQResult<()> {
if let Some(negative_event) = old_refund {
self.log_event(&KafkaEvent::old(
&KafkaRefund::from_storage(&negative_event),
... | crates/router/src/services/kafka.rs | router | function_signature | 238 | rust | null | null | null | null | log_refund | null | null | null | null | null | null | null |
File: crates/router/src/types/storage/role.rs
pub use diesel_models::role::*;
| crates/router/src/types/storage/role.rs | router | full_file | 18 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct FrmBlockRate; | crates/api_models/src/analytics/frm.rs | api_models | struct_definition | 6 | rust | FrmBlockRate | null | null | null | null | null | null | null | null | null | null | null |
File: crates/api_models/src/user.rs
Public structs: 59
use std::fmt::Debug;
use common_enums::{EntityType, TokenPurpose};
use common_utils::{crypto::OptionalEncryptableName, id_type, pii};
use masking::Secret;
use utoipa::ToSchema;
use crate::user_role::UserStatus;
pub mod dashboard_metadata;
#[cfg(feature = "dummy... | crates/api_models/src/user.rs | api_models | full_file | 2,962 | null | null | null | null | null | null | null | null | null | null | null | null | null |
File: crates/analytics/src/sdk_events/metrics/load_time.rs
use std::collections::HashSet;
use api_models::analytics::{
sdk_events::{
SdkEventDimensions, SdkEventFilters, SdkEventMetricsBucketIdentifier, SdkEventNames,
},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use err... | crates/analytics/src/sdk_events/metrics/load_time.rs | analytics | full_file | 834 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub async fn construct_external_vault_proxy_payment_router_data<'a>(
state: &'a SessionState,
payment_data: hyperswitch_domain_models::payments::PaymentConfirmData<api::ExternalVaultProxy>,
connector_id: &str,
merchant_context: &domain::MerchantContext,
customer: &'a Option<domain::Customer>,
me... | crates/router/src/core/payments/transformers.rs | router | function_signature | 1,350 | rust | null | null | null | null | construct_external_vault_proxy_payment_router_data | null | null | null | null | null | null | null |
Documentation: api-reference/v1/merchant-connector-account/merchant-connector--create.mdx
# Type: Doc File
---
openapi: post /accounts/{account_id}/connectors
--- | api-reference/v1/merchant-connector-account/merchant-connector--create.mdx | null | doc_file | 41 | doc | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct TsysSearchTransactionRequest {
#[serde(rename = "deviceID")]
device_id: Secret<String>,
transaction_key: Secret<String>,
#[serde(rename = "transactionID")]
transaction_id: String,
#[serde(rename = "developerID")]
developer_id: Secret<String>,
} | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs | hyperswitch_connectors | struct_definition | 63 | rust | TsysSearchTransactionRequest | null | null | null | null | null | null | null | null | null | null | null |
pub struct PaymentResponse {
pub payment: Payment,
pub merchant_action: Option<MerchantAction>,
} | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs | hyperswitch_connectors | struct_definition | 22 | rust | PaymentResponse | null | null | null | null | null | null | null | null | null | null | null |
pub struct CaptureResponse {
data: CaptureResponseData,
} | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs | hyperswitch_connectors | struct_definition | 13 | rust | CaptureResponse | null | null | null | null | null | null | null | null | null | null | null |
impl Responder {
let algorithm_id = path.into_inner();
let flow = Flow::RoutingRetrieveConfig;
Box::pin(oss_api::server_wrap(
flow,
state,
&req,
algorithm_id,
|state, auth: auth::AuthenticationData, algorithm_id, _| {
let merchant_context = domain::Merchan... | crates/router/src/routes/routing.rs | router | impl_block | 239 | rust | null | Responder | null | impl Responder | null | null | null | null | null | null | null | null |
pub struct TrustpayRedirectResponse {
pub status: Option<String>,
} | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs | hyperswitch_connectors | struct_definition | 15 | rust | TrustpayRedirectResponse | null | null | null | null | null | null | null | null | null | null | null |
pub struct GlobalPayMeta {
account_name: Secret<String>,
} | crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs | hyperswitch_connectors | struct_definition | 14 | rust | GlobalPayMeta | null | null | null | null | null | null | null | null | null | null | null |
impl Verify {
pub fn server(state: AppState) -> Scope {
web::scope("/v2/verify")
.app_data(web::Data::new(state))
.service(
web::resource("/apple-pay/{merchant_id}")
.route(web::post().to(apple_pay_merchant_registration)),
)
... | crates/router/src/routes/app.rs | router | impl_block | 104 | rust | null | Verify | null | impl Verify | null | null | null | null | null | null | null | null |
File: crates/router/src/core/payments/operations/payment_complete_authorize.rs
Public structs: 1
use std::marker::PhantomData;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
use error_stack::{report, ResultExt};
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use sup... | crates/router/src/core/payments/operations/payment_complete_authorize.rs | router | full_file | 4,066 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct BankOfAmericaTransactionResponse {
id: String,
application_information: ApplicationInformation,
client_reference_information: Option<ClientReferenceInformation>,
processor_information: Option<ClientProcessorInformation>,
processing_information: Option<ProcessingInformationResponse>,
p... | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs | hyperswitch_connectors | struct_definition | 137 | rust | BankOfAmericaTransactionResponse | null | null | null | null | null | null | null | null | null | null | null |
pub struct MigrateNetworkTokenData {
/// Network Token Number
#[schema(value_type = String,example = "4111111145551142")]
pub network_token_number: CardNumber,
/// Network Token Expiry Month
#[schema(value_type = String,example = "10")]
pub network_token_exp_month: masking::Secret<String>,
... | crates/api_models/src/payment_methods.rs | api_models | struct_definition | 276 | rust | MigrateNetworkTokenData | null | null | null | null | null | null | null | null | null | null | null |
pub struct OpenSearchIndexes {
pub payment_attempts: String,
pub payment_intents: String,
pub refunds: String,
pub disputes: String,
pub sessionizer_payment_attempts: String,
pub sessionizer_payment_intents: String,
pub sessionizer_refunds: String,
pub sessionizer_disputes: String,
} | crates/analytics/src/opensearch.rs | analytics | struct_definition | 72 | rust | OpenSearchIndexes | null | null | null | null | null | null | null | null | null | null | null |
impl SurchargeDetails {
pub fn get_total_surcharge_amount(&self) -> MinorUnit {
self.surcharge_amount + self.tax_on_surcharge_amount
}
} | crates/hyperswitch_domain_models/src/router_request_types.rs | hyperswitch_domain_models | impl_block | 37 | rust | null | SurchargeDetails | null | impl SurchargeDetails | null | null | null | null | null | null | null | null |
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
} | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs | hyperswitch_connectors | function_signature | 27 | rust | null | null | null | null | new | null | null | null | null | null | null | null |
pub fn new(
shipping: Option<Address>,
billing: Option<Address>,
payment_method_billing: Option<Address>,
should_unify_address: Option<bool>,
) -> Self {
// billing -> .billing, this is the billing details passed in the root of payments request
// payment_method_billi... | crates/hyperswitch_domain_models/src/payment_address.rs | hyperswitch_domain_models | function_signature | 264 | rust | null | null | null | null | new | null | null | null | null | null | null | null |
pub struct SurchargeDecisionConfigReq {
pub name: Option<String>,
pub merchant_surcharge_configs: MerchantSurchargeConfigs,
pub algorithm: Option<Program<SurchargeDecisionConfigs>>,
} | crates/api_models/src/surcharge_decision_configs.rs | api_models | struct_definition | 41 | rust | SurchargeDecisionConfigReq | null | null | null | null | null | null | null | null | null | null | null |
pub struct PaytmRouterData<T> {
pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
pub router_data: T,
} | crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs | hyperswitch_connectors | struct_definition | 50 | rust | PaytmRouterData | null | null | null | null | null | null | null | null | null | null | null |
impl SurchargeSource {
pub fn generate_surcharge_details_and_populate_surcharge_metadata(
&self,
backend_input: &backend::BackendInput,
payment_attempt: &storage::PaymentAttempt,
surcharge_metadata_and_key: (&mut types::SurchargeMetadata, types::SurchargeKey),
) -> ConditionalCon... | crates/router/src/core/payment_methods/surcharge_decision_configs.rs | router | impl_block | 262 | rust | null | SurchargeSource | null | impl SurchargeSource | null | null | null | null | null | null | null | null |
impl Responder {
let flow = Flow::ApiKeyList;
let list_api_key_constraints = query.into_inner();
let limit = list_api_key_constraints.limit;
let offset = list_api_key_constraints.skip;
let merchant_id = path.into_inner();
Box::pin(api::server_wrap(
flow,
state,
&req,
... | crates/router/src/routes/api_keys.rs | router | impl_block | 210 | rust | null | Responder | null | impl Responder | null | null | null | null | null | null | null | null |
pub async fn get_lookup_key_from_locker(
state: &routes::SessionState,
payment_token: &str,
pm: &domain::PaymentMethod,
merchant_key_store: &domain::MerchantKeyStore,
) -> errors::RouterResult<api::CardDetailFromLocker> {
let card_detail = get_card_details_from_locker(state, pm).await?;
let card... | crates/router/src/core/payment_methods/cards.rs | router | function_signature | 134 | rust | null | null | null | null | get_lookup_key_from_locker | null | null | null | null | null | null | null |
File: crates/router/src/services/authentication/detached.rs
Public functions: 2
Public structs: 1
use std::{borrow::Cow, string::ToString};
use actix_web::http::header::HeaderMap;
use common_utils::{
crypto::VerifySignature,
id_type::{ApiKeyId, MerchantId},
};
use error_stack::ResultExt;
use hyperswitch_dom... | crates/router/src/services/authentication/detached.rs | router | full_file | 903 | null | null | null | null | null | null | null | null | null | null | null | null | null |
File: crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
Public functions: 7
Public structs: 104
use std::{collections::HashMap, fmt::Debug, ops::Deref};
use api_models::{self, enums as api_enums, payments};
use common_enums::{enums, AttemptStatus, PaymentChargeType, StripeChargeType};
use common_t... | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs#chunk0 | hyperswitch_connectors | chunk | 8,185 | null | null | null | null | null | null | null | null | null | null | null | null | null |
impl api::PaymentAuthorize for Fiserv {} | crates/hyperswitch_connectors/src/connectors/fiserv.rs | hyperswitch_connectors | impl_block | 10 | rust | null | Fiserv | api::PaymentAuthorize for | impl api::PaymentAuthorize for for Fiserv | null | null | null | null | null | null | null | null |
File: crates/hyperswitch_domain_models/src/chat.rs
Public structs: 2
use common_utils::id_type;
use masking::Secret;
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct GetDataMessage {
pub message: Secret<String>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct H... | crates/hyperswitch_domain_models/src/chat.rs | hyperswitch_domain_models | full_file | 122 | null | null | null | null | null | null | null | null | null | null | null | null | null |
pub struct FrmFilterValue {
pub dimension: FrmDimensions,
pub values: Vec<String>,
} | crates/api_models/src/analytics.rs | api_models | struct_definition | 21 | rust | FrmFilterValue | null | null | null | null | null | null | null | null | null | null | null |
pub struct PaymentInsightsInformation {
response_insights: Option<ResponseInsights>,
rule_results: Option<RuleResults>,
} | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs | hyperswitch_connectors | struct_definition | 27 | rust | PaymentInsightsInformation | null | null | null | null | null | null | null | null | null | null | null |
pub trait DynamicRoutingAlgoAccessor {
fn get_algorithm_id_with_timestamp(
self,
) -> DynamicAlgorithmWithTimestamp<common_utils::id_type::RoutingId>;
fn get_enabled_features(&mut self) -> &mut DynamicRoutingFeatures;
} | crates/api_models/src/routing.rs | api_models | trait_definition | 53 | rust | null | null | DynamicRoutingAlgoAccessor | null | null | null | null | null | null | null | null | null |
impl api::ConnectorAccessToken for Payeezy {} | crates/hyperswitch_connectors/src/connectors/payeezy.rs | hyperswitch_connectors | impl_block | 10 | rust | null | Payeezy | api::ConnectorAccessToken for | impl api::ConnectorAccessToken for for Payeezy | null | null | null | null | null | null | null | null |
impl api::PaymentAuthorize for Nexinets {} | crates/hyperswitch_connectors/src/connectors/nexinets.rs | hyperswitch_connectors | impl_block | 10 | rust | null | Nexinets | api::PaymentAuthorize for | impl api::PaymentAuthorize for for Nexinets | null | null | null | null | null | null | null | null |
pub async 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::Vaul... | crates/router/src/core/payment_methods/vault.rs | router | function_signature | 299 | rust | null | null | null | null | add_payment_method_to_vault | null | null | null | null | null | null | null |
pub fn get_merchant_details_as_secret(
&self,
) -> CustomResult<Option<pii::SecretSerdeValue>, errors::ParsingError> {
self.merchant_details
.as_ref()
.map(|merchant_details| merchant_details.encode_to_value().map(Secret::new))
.transpose()
} | crates/api_models/src/admin.rs | api_models | function_signature | 69 | rust | null | null | null | null | get_merchant_details_as_secret | null | null | null | null | null | null | null |
pub fn get_google_pay_wallet_data(&self) -> Option<&GooglePayWalletData> {
if let Self::GooglePay(google_pay_wallet_data) = self {
Some(google_pay_wallet_data)
} else {
None
}
} | crates/hyperswitch_domain_models/src/payment_method_data.rs | hyperswitch_domain_models | function_signature | 54 | rust | null | null | null | null | get_google_pay_wallet_data | null | null | null | null | null | null | null |
File: crates/scheduler/src/consumer.rs
Public functions: 7
// TODO: Figure out what to log
use std::{
sync::{self, atomic},
time as std_time,
};
pub mod types;
pub mod workflows;
use common_utils::{errors::CustomResult, id_type, signals::get_allowed_signals};
use diesel_models::enums;
pub use diesel_models:... | crates/scheduler/src/consumer.rs | scheduler | full_file | 2,130 | null | null | null | null | null | null | 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.