repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 30
values | content stringlengths 0 5.21M | token_count int64 0 3.8M |
|---|---|---|---|---|
hyperswitch | crates/connector_configs/src/common_config.rs | .rs | use api_models::{payment_methods, payments};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(rename_all = "snake_case")]
pub struct ZenApplePay {
pub terminal_uuid: Option<String>,
pub pay_wall_secret... | 1,772 |
hyperswitch | crates/test_utils/Cargo.toml | .toml | [package]
name = "test_utils"
description = "Postman collection runner and utility"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
readme = "README.md"
license.workspace = true
[features]
default = ["dummy_connector", "payouts"]
dummy_connector = []
payouts = []
[dependencies]
anyhow = "1.0.... | 328 |
hyperswitch | crates/test_utils/README.md | .md | # Test Utils
The heart of `newman`(with directory support) and `UI-tests`
> [!NOTE]
> If you're developing a collection and you want to learn more about it, click [_**here**_](/postman/README.md)
## Newman
- Make sure you that you _**do not**_ have the newman (from the Postman team) installed but rather the `newman... | 993 |
hyperswitch | crates/test_utils/tests/sample_auth.toml | .toml | # Copy this file and rename it as `auth.toml`
# Each of the connector's section is optional
[aci]
api_key = "Bearer MyApiKey"
key1 = "MyEntityId"
[adyen]
api_key = "Bearer MyApiKey"
key1 = "MerchantId"
api_secret = "Secondary key"
[authorizedotnet]
api_key = "MyMerchantName"
key1 = "MyTransactionKey"
[checkout]
api... | 816 |
hyperswitch | crates/test_utils/tests/connectors/zen_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct ZenSeleniumTest;
impl SeleniumTest for ZenSeleniumTest {
fn get_connector_name(&self) -> String {
"zen".to_string()
}
}
async fn should_make_zen_3ds_payment(web_driver: WebDriver) -> Result<(),... | 308 |
hyperswitch | crates/test_utils/tests/connectors/shift4_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct Shift4SeleniumTest;
impl SeleniumTest for Shift4SeleniumTest {
fn get_connector_name(&self) -> String {
"shift4".to_string()
}
}
async fn should_make_3ds_payment(c: WebDriver) -> Result<(), Web... | 929 |
hyperswitch | crates/test_utils/tests/connectors/payu_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct PayUSeleniumTest;
impl SeleniumTest for PayUSeleniumTest {
fn get_connector_name(&self) -> String {
"payu".to_string()
}
}
async fn should_make_no_3ds_card_payment(web_driver: WebDriver) -> Res... | 375 |
hyperswitch | crates/test_utils/tests/connectors/trustpay_3ds_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct TrustpaySeleniumTest;
impl SeleniumTest for TrustpaySeleniumTest {
fn get_connector_name(&self) -> String {
"trustpay_3ds".to_string()
}
}
async fn should_make_trustpay_3ds_payment(web_driver: ... | 277 |
hyperswitch | crates/test_utils/tests/connectors/adyen_uk_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct AdyenSeleniumTest;
impl SeleniumTest for AdyenSeleniumTest {
fn get_connector_name(&self) -> String {
"adyen_uk".to_string()
}
}
async fn should_make_adyen_3ds_payment_failed(web_driver: WebDri... | 7,588 |
hyperswitch | crates/test_utils/tests/connectors/authorizedotnet_wh_ui.rs | .rs | use rand::Rng;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct AuthorizedotnetSeleniumTest;
impl SeleniumTest for AuthorizedotnetSeleniumTest {
fn get_connector_name(&self) -> String {
"authorizedotnet".to_string()
}
}
async fn should_make_webhook(web_driver: WebDri... | 259 |
hyperswitch | crates/test_utils/tests/connectors/worldline_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct WorldlineSeleniumTest;
impl SeleniumTest for WorldlineSeleniumTest {
fn get_connector_name(&self) -> String {
"worldline".to_string()
}
}
async fn should_make_card_non_3ds_payment(c: WebDriver)... | 577 |
hyperswitch | crates/test_utils/tests/connectors/bluesnap_wh_ui.rs | .rs | use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct BluesnapSeleniumTest;
impl SeleniumTest for BluesnapSeleniumTest {
fn get_connector_name(&self) -> String {
"bluesnap".to_string()
}
}
async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {... | 189 |
hyperswitch | crates/test_utils/tests/connectors/bluesnap_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct BluesnapSeleniumTest;
impl SeleniumTest for BluesnapSeleniumTest {
fn get_connector_name(&self) -> String {
"bluesnap".to_string()
}
}
async fn should_make_3ds_payment(driver: WebDriver) -> Res... | 507 |
hyperswitch | crates/test_utils/tests/connectors/checkout_wh_ui.rs | .rs | use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct CheckoutSeleniumTest;
impl SeleniumTest for CheckoutSeleniumTest {
fn get_connector_name(&self) -> String {
"checkout".to_string()
}
}
async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {... | 225 |
hyperswitch | crates/test_utils/tests/connectors/selenium.rs | .rs | #![allow(
clippy::expect_used,
clippy::panic,
clippy::unwrap_in_result,
clippy::missing_panics_doc,
clippy::unwrap_used
)]
use std::{
collections::{HashMap, HashSet},
env,
io::Read,
path::{MAIN_SEPARATOR, MAIN_SEPARATOR_STR},
time::Duration,
};
use async_trait::async_trait;
use ... | 7,280 |
hyperswitch | crates/test_utils/tests/connectors/stripe_wh_ui.rs | .rs | use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct StripeSeleniumTest;
impl SeleniumTest for StripeSeleniumTest {
fn get_connector_name(&self) -> String {
"stripe".to_string()
}
}
async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
l... | 196 |
hyperswitch | crates/test_utils/tests/connectors/authorizedotnet_ui.rs | .rs | use rand::Rng;
use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct AuthorizedotnetSeleniumTest;
impl SeleniumTest for AuthorizedotnetSeleniumTest {
fn get_connector_name(&self) -> String {
"authorizedotnet".to_string()
}
}
async fn should_make_g... | 496 |
hyperswitch | crates/test_utils/tests/connectors/nexinets_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct NexinetsSeleniumTest;
impl SeleniumTest for NexinetsSeleniumTest {
fn get_connector_name(&self) -> String {
"nexinets".to_string()
}
}
async fn should_make_paypal_payment(web_driver: WebDriver)... | 671 |
hyperswitch | crates/test_utils/tests/connectors/nuvei_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct NuveiSeleniumTest;
impl SeleniumTest for NuveiSeleniumTest {
fn get_connector_name(&self) -> String {
"nuvei".to_string()
}
}
async fn should_make_nuvei_3ds_payment(c: WebDriver) -> Result<(), ... | 2,482 |
hyperswitch | crates/test_utils/tests/connectors/main.rs | .rs | #![allow(
clippy::expect_used,
clippy::panic,
clippy::unwrap_in_result,
clippy::unwrap_used,
clippy::print_stderr
)]
mod aci_ui;
mod adyen_uk_ui;
mod adyen_uk_wh_ui;
mod airwallex_ui;
mod authorizedotnet_ui;
mod authorizedotnet_wh_ui;
mod bambora_ui;
mod bluesnap_ui;
mod bluesnap_wh_ui;
mod checkout... | 179 |
hyperswitch | crates/test_utils/tests/connectors/aci_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct AciSeleniumTest;
impl SeleniumTest for AciSeleniumTest {
fn get_connector_name(&self) -> String {
"aci".to_string()
}
}
async fn should_make_aci_card_mandate_payment(web_driver: WebDriver) -> R... | 2,235 |
hyperswitch | crates/test_utils/tests/connectors/globalpay_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct GlobalpaySeleniumTest;
impl SeleniumTest for GlobalpaySeleniumTest {
fn get_connector_name(&self) -> String {
"globalpay".to_string()
}
}
async fn should_make_gpay_payment(driver: WebDriver) ->... | 1,705 |
hyperswitch | crates/test_utils/tests/connectors/mollie_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct MollieSeleniumTest;
impl SeleniumTest for MollieSeleniumTest {
fn get_connector_name(&self) -> String {
"mollie".to_string()
}
}
async fn should_make_mollie_paypal_payment(web_driver: WebDriver... | 1,898 |
hyperswitch | crates/test_utils/tests/connectors/noon_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct NoonSeleniumTest;
impl SeleniumTest for NoonSeleniumTest {
fn get_connector_name(&self) -> String {
"noon".to_string()
}
}
async fn should_make_noon_3ds_payment(web_driver: WebDriver) -> Result... | 866 |
hyperswitch | crates/test_utils/tests/connectors/paypal_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct PaypalSeleniumTest;
impl SeleniumTest for PaypalSeleniumTest {
fn get_connector_name(&self) -> String {
"paypal".to_string()
}
}
async fn should_make_paypal_paypal_wallet_payment(
web_drive... | 845 |
hyperswitch | crates/test_utils/tests/connectors/stripe_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct StripeSeleniumTest;
impl SeleniumTest for StripeSeleniumTest {
fn get_connector_name(&self) -> String {
"stripe".to_string()
}
}
async fn should_make_3ds_payment(c: WebDriver) -> Result<(), Web... | 4,825 |
hyperswitch | crates/test_utils/tests/connectors/multisafepay_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct MultisafepaySeleniumTest;
impl SeleniumTest for MultisafepaySeleniumTest {
fn get_connector_name(&self) -> String {
"multisafepay".to_string()
}
}
async fn should_make_multisafepay_3ds_payment_... | 724 |
hyperswitch | crates/test_utils/tests/connectors/adyen_uk_wh_ui.rs | .rs | use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct AdyenSeleniumTest;
impl SeleniumTest for AdyenSeleniumTest {
fn get_connector_name(&self) -> String {
"adyen_uk".to_string()
}
}
async fn should_make_webhook(web_driver: WebDriver) -> Result<(), WebDriverError> {
l... | 190 |
hyperswitch | crates/test_utils/tests/connectors/checkout_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct CheckoutSeleniumTest;
impl SeleniumTest for CheckoutSeleniumTest {
fn get_connector_name(&self) -> String {
"checkout".to_string()
}
}
async fn should_make_frictionless_3ds_payment(c: WebDriver... | 796 |
hyperswitch | crates/test_utils/tests/connectors/airwallex_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct AirwallexSeleniumTest;
impl SeleniumTest for AirwallexSeleniumTest {
fn get_connector_name(&self) -> String {
"airwallex".to_string()
}
}
async fn should_make_airwallex_3ds_payment(web_driver: ... | 576 |
hyperswitch | crates/test_utils/tests/connectors/bambora_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct BamboraSeleniumTest;
impl SeleniumTest for BamboraSeleniumTest {
fn get_connector_name(&self) -> String {
"bambora".to_string()
}
}
async fn should_make_3ds_payment(c: WebDriver) -> Result<(), ... | 225 |
hyperswitch | crates/test_utils/src/newman_runner.rs | .rs | use std::{
env,
fs::{self, OpenOptions},
io::{self, Write},
path::Path,
process::{exit, Command},
};
use anyhow::{Context, Result};
use clap::{arg, command, Parser, ValueEnum};
use masking::PeekInterface;
use regex::Regex;
use crate::connector_auth::{
ConnectorAuthType, ConnectorAuthentication... | 3,271 |
hyperswitch | crates/test_utils/src/main.rs | .rs | #![allow(clippy::print_stdout, clippy::print_stderr)]
use std::process::{exit, Command};
use anyhow::Result;
use test_utils::newman_runner;
fn main() -> Result<()> {
let mut runner = newman_runner::generate_runner()?;
// Execute the newman command
let output = runner.newman_command.spawn();
let mut ... | 375 |
hyperswitch | crates/test_utils/src/connector_auth.rs | .rs | use std::{collections::HashMap, env};
use masking::Secret;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ConnectorAuthentication {
pub aci: Option<BodyKey>,
#[cfg(not(feature = "payouts"))]
pub adyen: Option<BodyKey>,
#[cfg(feature = "payouts")]
pu... | 2,995 |
hyperswitch | crates/test_utils/src/lib.rs | .rs | #![allow(clippy::print_stdout, clippy::print_stderr)]
pub mod connector_auth;
pub mod newman_runner;
| 25 |
hyperswitch | crates/drainer/Cargo.toml | .toml | [package]
name = "drainer"
description = "Application that reads Redis streams and executes queries in database"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
readme = "README.md"
license.workspace = true
[features]
release = ["vergen", "external_services/aws_kms"]
vergen = ["router_env/verg... | 620 |
hyperswitch | crates/drainer/build.rs | .rs | fn main() {
#[cfg(feature = "vergen")]
router_env::vergen::generate_cargo_instructions();
}
| 26 |
hyperswitch | crates/drainer/README.md | .md | # Drainer
Application that reads Redis streams and executes queries in database.
| 15 |
hyperswitch | crates/drainer/src/query.rs | .rs | use std::sync::Arc;
use common_utils::errors::CustomResult;
use diesel_models::errors::DatabaseError;
use crate::{kv, logger, metrics, pg_connection, services::Store};
#[async_trait::async_trait]
pub trait ExecuteQuery {
async fn execute_query(
self,
store: &Arc<Store>,
pushed_at: i64,
... | 489 |
hyperswitch | crates/drainer/src/metrics.rs | .rs | use router_env::{counter_metric, global_meter, histogram_metric_f64, histogram_metric_u64};
global_meter!(DRAINER_METER, "DRAINER");
counter_metric!(JOBS_PICKED_PER_STREAM, DRAINER_METER);
counter_metric!(CYCLES_COMPLETED_SUCCESSFULLY, DRAINER_METER);
counter_metric!(CYCLES_COMPLETED_UNSUCCESSFULLY, DRAINER_METER);
c... | 318 |
hyperswitch | crates/drainer/src/connection.rs | .rs | use bb8::PooledConnection;
use common_utils::DbConnectionParams;
use diesel::PgConnection;
use crate::{settings::Database, Settings};
pub type PgPool = bb8::Pool<async_bb8_diesel::ConnectionManager<PgConnection>>;
#[allow(clippy::expect_used)]
pub async fn redis_connection(conf: &Settings) -> redis_interface::RedisC... | 324 |
hyperswitch | crates/drainer/src/health_check.rs | .rs | use std::{collections::HashMap, sync::Arc};
use actix_web::{web, Scope};
use async_bb8_diesel::{AsyncConnection, AsyncRunQueryDsl};
use common_utils::{errors::CustomResult, id_type};
use diesel_models::{Config, ConfigNew};
use error_stack::ResultExt;
use router_env::{instrument, logger, tracing};
use crate::{
con... | 2,002 |
hyperswitch | crates/drainer/src/settings.rs | .rs | use std::{collections::HashMap, path::PathBuf, sync::Arc};
use common_utils::{ext_traits::ConfigExt, id_type, DbConnectionParams};
use config::{Environment, File};
use external_services::managers::{
encryption_management::EncryptionManagementConfig, secrets_management::SecretsManagementConfig,
};
use hyperswitch_i... | 2,456 |
hyperswitch | crates/drainer/src/utils.rs | .rs | use std::sync::{atomic, Arc};
use error_stack::report;
use redis_interface as redis;
use serde::de::Deserialize;
use crate::{
errors, kv, metrics,
stream::{StreamEntries, StreamReadResult},
};
pub fn parse_stream_entries<'a>(
read_result: &'a StreamReadResult,
stream_name: &str,
) -> errors::DrainerR... | 611 |
hyperswitch | crates/drainer/src/handler.rs | .rs | use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use common_utils::id_type;
use router_env::tracing::Instrument;
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSettings,
Store,... | 2,127 |
hyperswitch | crates/drainer/src/main.rs | .rs | use std::collections::HashMap;
use drainer::{errors::DrainerResult, logger, services, settings, start_drainer, start_web_server};
use router_env::tracing::Instrument;
#[tokio::main]
async fn main() -> DrainerResult<()> {
// Get configuration
let cmd_line = <settings::CmdLineConf as clap::Parser>::parse();
... | 440 |
hyperswitch | crates/drainer/src/types.rs | .rs | use std::collections::HashMap;
use common_utils::errors;
use error_stack::ResultExt;
use serde::{de::value::MapDeserializer, Deserialize, Serialize};
use crate::{
kv,
utils::{deserialize_db_op, deserialize_i64},
};
#[derive(Deserialize, Serialize)]
pub struct StreamData {
pub request_id: String,
pub ... | 224 |
hyperswitch | crates/drainer/src/stream.rs | .rs | use std::collections::HashMap;
use redis_interface as redis;
use router_env::{logger, tracing};
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
impl Store {
#[inline(always)]
pub fn drainer_stre... | 887 |
hyperswitch | crates/drainer/src/logger.rs | .rs | #[doc(inline)]
pub use router_env::{debug, error, info, warn};
| 18 |
hyperswitch | crates/drainer/src/lib.rs | .rs | mod connection;
pub mod errors;
mod handler;
mod health_check;
pub mod logger;
pub(crate) mod metrics;
mod query;
pub mod services;
pub mod settings;
mod stream;
mod types;
mod utils;
use std::{collections::HashMap, sync::Arc};
mod secrets_transformers;
use actix_web::dev::Server;
use common_utils::{id_type, signals::... | 513 |
hyperswitch | crates/drainer/src/errors.rs | .rs | use redis_interface as redis;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum DrainerError {
#[error("Error in parsing config : {0}")]
ConfigParsingError(String),
#[error("Error during redis operation : {0:?}")]
RedisError(error_stack::Report<redis::errors::RedisError>),
#[error("Application... | 446 |
hyperswitch | crates/drainer/src/secrets_transformers.rs | .rs | use common_utils::errors::CustomResult;
use hyperswitch_interfaces::secrets_interface::{
secret_handler::SecretsHandler,
secret_state::{RawSecret, SecretStateContainer, SecuredSecret},
SecretManagementInterface, SecretsManagementError,
};
use crate::settings::{Database, Settings};
#[async_trait::async_tra... | 349 |
hyperswitch | crates/drainer/src/services.rs | .rs | use std::sync::Arc;
use actix_web::{body, HttpResponse, ResponseError};
use error_stack::Report;
use redis_interface::RedisConnectionPool;
use crate::{
connection::{diesel_make_pg_pool, PgPool},
logger,
settings::Tenant,
};
#[derive(Clone)]
pub struct Store {
pub master_pool: PgPool,
pub redis_co... | 464 |
hyperswitch | crates/euclid/Cargo.toml | .toml | [package]
name = "euclid"
description = "DSL for static routing"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
nom = { version = "7.1.3", features = ["alloc"], optional = true }
once_cell = "1.19.0"
rustc-hash = "1.1.0"
serde = { version = "1.0.197", f... | 365 |
hyperswitch | crates/euclid/benches/backends.rs | .rs | #![allow(unused, clippy::expect_used)]
use common_utils::types::MinorUnit;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use euclid::{
backend::{inputs, EuclidBackend, InterpreterBackend, VirInterpreterBackend},
enums,
frontend::ast::{self, parser},
types::DummyOutput,
};
fn ... | 645 |
hyperswitch | crates/euclid/src/frontend.rs | .rs | pub mod ast;
pub mod dir;
pub mod vir;
| 12 |
hyperswitch | crates/euclid/src/enums.rs | .rs | pub use common_enums::{
AuthenticationType, CaptureMethod, CardNetwork, Country, CountryAlpha2, Currency,
FutureUsage as SetupFutureUsage, PaymentMethod, PaymentMethodType, RoutableConnectors,
};
use strum::VariantNames;
pub trait CollectVariants {
fn variants<T: FromIterator<String>>() -> T;
}
macro_rules... | 902 |
hyperswitch | crates/euclid/src/dssa.rs | .rs | //! Domain Specific Static Analyzer
pub mod analyzer;
pub mod graph;
pub mod state_machine;
pub mod truth;
pub mod types;
pub mod utils;
| 31 |
hyperswitch | crates/euclid/src/types.rs | .rs | pub mod transformers;
use common_utils::types::MinorUnit;
use euclid_macros::EnumNums;
use serde::{Deserialize, Serialize};
use strum::VariantNames;
use crate::{
dssa::types::EuclidAnalysable,
enums,
frontend::{
ast,
dir::{DirKeyKind, DirValue, EuclidDirFilter},
},
};
pub type Metadat... | 2,430 |
hyperswitch | crates/euclid/src/lib.rs | .rs | #![allow(clippy::result_large_err)]
pub mod backend;
pub mod dssa;
pub mod enums;
pub mod frontend;
pub mod types;
| 30 |
hyperswitch | crates/euclid/src/backend.rs | .rs | pub mod inputs;
pub mod interpreter;
#[cfg(feature = "valued_jit")]
pub mod vir_interpreter;
pub use inputs::BackendInput;
pub use interpreter::InterpreterBackend;
#[cfg(feature = "valued_jit")]
pub use vir_interpreter::VirInterpreterBackend;
use crate::frontend::ast;
#[derive(Debug, Clone, serde::Serialize)]
pub st... | 157 |
hyperswitch | crates/euclid/src/types/transformers.rs | .rs | 1 | |
hyperswitch | crates/euclid/src/frontend/vir.rs | .rs | //! Valued Intermediate Representation
use serde::{Deserialize, Serialize};
use crate::types::{EuclidValue, Metadata};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ValuedComparisonLogic {
NegativeConjunction,
PositiveDisjunction,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Valued... | 232 |
hyperswitch | crates/euclid/src/frontend/dir.rs | .rs | //! Domain Intermediate Representation
pub mod enums;
pub mod lowering;
pub mod transformers;
use strum::IntoEnumIterator;
// use common_utils::types::MinorUnit;
use crate::{enums as euclid_enums, frontend::ast, types};
#[macro_export]
macro_rules! dirval {
(Connector = $name:ident) => {
$crate::frontend... | 7,424 |
hyperswitch | crates/euclid/src/frontend/ast.rs | .rs | pub mod lowering;
#[cfg(feature = "ast_parser")]
pub mod parser;
use common_enums::RoutableConnectors;
use common_utils::types::MinorUnit;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
use crate::types::{DataType, Metadata};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct... | 1,366 |
hyperswitch | crates/euclid/src/frontend/ast/parser.rs | .rs | use common_utils::types::MinorUnit;
use nom::{
branch, bytes::complete, character::complete as pchar, combinator, error, multi, sequence,
};
use crate::{frontend::ast, types::DummyOutput};
pub type ParseResult<T, U> = nom::IResult<T, U, error::VerboseError<T>>;
pub enum EuclidError {
InvalidPercentage(String)... | 3,334 |
hyperswitch | crates/euclid/src/frontend/ast/lowering.rs | .rs | //! Analysis for the Lowering logic in ast
//!
//!Certain functions that can be used to perform the complete lowering of ast to dir.
//!This includes lowering of enums, numbers, strings as well as Comparison logics.
use std::str::FromStr;
use crate::{
dssa::types::{AnalysisError, AnalysisErrorType},
enums::Co... | 2,949 |
hyperswitch | crates/euclid/src/frontend/dir/enums.rs | .rs | use strum::VariantNames;
use crate::enums::collect_variants;
pub use crate::enums::{
AuthenticationType, CaptureMethod, CardNetwork, Country, Country as BusinessCountry,
Country as BillingCountry, CountryAlpha2, Currency as PaymentCurrency, MandateAcceptanceType,
MandateType, PaymentMethod, PaymentType, Ro... | 1,955 |
hyperswitch | crates/euclid/src/frontend/dir/transformers.rs | .rs | use crate::{dirval, dssa::types::AnalysisErrorType, enums as global_enums, frontend::dir};
pub trait IntoDirValue {
fn into_dir_value(self) -> Result<dir::DirValue, AnalysisErrorType>;
}
impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMethod) {
fn into_dir_value(self) -> Result<dir... | 3,037 |
hyperswitch | crates/euclid/src/frontend/dir/lowering.rs | .rs | //! Analysis of the lowering logic for the DIR
//!
//! Consists of certain functions that supports the lowering logic from DIR to VIR.
//! These includes the lowering of the DIR program and vector of rules , and the lowering of ifstatements
//! ,and comparisonsLogic and also the lowering of the enums of value variants ... | 3,676 |
hyperswitch | crates/euclid/src/dssa/truth.rs | .rs | use euclid_macros::knowledge;
use once_cell::sync::Lazy;
use crate::{dssa::graph::euclid_graph_prelude, frontend::dir};
pub static ANALYSIS_GRAPH: Lazy<hyperswitch_constraint_graph::ConstraintGraph<dir::DirValue>> =
Lazy::new(|| {
knowledge! {
// Payment Method should be `Card` for a CardType ... | 308 |
hyperswitch | crates/euclid/src/dssa/utils.rs | .rs | pub struct Unpacker;
| 6 |
hyperswitch | crates/euclid/src/dssa/graph.rs | .rs | use std::{fmt::Debug, sync::Weak};
use hyperswitch_constraint_graph as cgraph;
use rustc_hash::{FxHashMap, FxHashSet};
use crate::{
dssa::types,
frontend::dir,
types::{DataType, Metadata},
};
pub mod euclid_graph_prelude {
pub use hyperswitch_constraint_graph as cgraph;
pub use rustc_hash::{FxHas... | 7,969 |
hyperswitch | crates/euclid/src/dssa/types.rs | .rs | use std::{collections::HashMap, fmt};
use serde::Serialize;
use crate::{
dssa::{self, graph},
frontend::{ast, dir},
types::{DataType, EuclidValue, Metadata},
};
pub trait EuclidAnalysable: Sized {
fn get_dir_value_for_analysis(&self, rule_name: String) -> Vec<(dir::DirValue, Metadata)>;
}
#[derive(D... | 1,207 |
hyperswitch | crates/euclid/src/dssa/analyzer.rs | .rs | //! Static Analysis for the Euclid Rule DSL
//!
//! Exposes certain functions that can be used to perform static analysis over programs
//! in the Euclid Rule DSL. These include standard control flow analyses like testing
//! conflicting assertions, to Domain Specific Analyses making use of the
//! [`Knowledge Graph Fr... | 3,226 |
hyperswitch | crates/euclid/src/dssa/state_machine.rs | .rs | use super::types::EuclidAnalysable;
use crate::{dssa::types, frontend::dir, types::Metadata};
#[derive(Debug, Clone, serde::Serialize, thiserror::Error)]
#[serde(tag = "type", content = "info", rename_all = "snake_case")]
pub enum StateMachineError {
#[error("Index out of bounds: {0}")]
IndexOutOfBounds(&'stat... | 4,764 |
hyperswitch | crates/euclid/src/backend/vir_interpreter.rs | .rs | pub mod types;
use std::fmt::Debug;
use serde::{Deserialize, Serialize};
use crate::{
backend::{self, inputs, EuclidBackend},
frontend::{
ast,
dir::{self, EuclidDirFilter},
vir,
},
};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct VirInterpreterBackend<O> {
progra... | 4,987 |
hyperswitch | crates/euclid/src/backend/inputs.rs | .rs | use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};
use crate::enums;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MandateData {
pub mandate_acceptance_type: Option<enums::MandateAcceptanceType>,
pub mandate_type: Option<enums::MandateType>,
pub payment_type: Option<enums::Paymen... | 300 |
hyperswitch | crates/euclid/src/backend/interpreter.rs | .rs | pub mod types;
use common_utils::types::MinorUnit;
use crate::{
backend::{self, inputs, EuclidBackend},
frontend::ast,
};
pub struct InterpreterBackend<O> {
program: ast::Program<O>,
}
impl<O> InterpreterBackend<O>
where
O: Clone,
{
fn eval_number_comparison_array(
num: MinorUnit,
... | 1,262 |
hyperswitch | crates/euclid/src/backend/vir_interpreter/types.rs | .rs | use rustc_hash::{FxHashMap, FxHashSet};
use crate::{
backend::inputs::BackendInput,
dssa,
types::{self, EuclidKey, EuclidValue, MetadataValue, NumValueRefinement, StrValue},
};
#[derive(Debug, Clone, serde::Serialize, thiserror::Error)]
pub enum VirInterpreterError {
#[error("Error when lowering the p... | 1,038 |
hyperswitch | crates/euclid/src/backend/interpreter/types.rs | .rs | use std::{collections::HashMap, fmt, ops::Deref, string::ToString};
use serde::Serialize;
use crate::{backend::inputs, frontend::ast::ValueType, types::EuclidKey};
#[derive(Debug, Clone, Serialize, thiserror::Error)]
#[serde(tag = "type", content = "data", rename_all = "snake_case")]
pub enum InterpreterErrorType {
... | 508 |
hyperswitch | crates/events/Cargo.toml | .toml | [package]
name = "events"
description = "Events framework for generating events & some sample implementations"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
# First Party crates
masking = { version = "0.1.0", path = "../masking" }
router_env = { versio... | 177 |
hyperswitch | crates/events/src/actix.rs | .rs | use router_env::tracing_actix_web::RequestId;
use crate::EventInfo;
impl EventInfo for RequestId {
type Data = String;
fn data(&self) -> error_stack::Result<String, crate::EventsError> {
Ok(self.as_hyphenated().to_string())
}
fn key(&self) -> String {
"request_id".to_string()
}
}... | 84 |
hyperswitch | crates/events/src/lib.rs | .rs | #![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 published. This could be a simple logger, a message queue, or a databas... | 1,959 |
hyperswitch | crates/hyperswitch_interfaces/Cargo.toml | .toml | [package]
name = "hyperswitch_interfaces"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
readme = "README.md"
license.workspace = true
[features]
default = ["dummy_connector", "frm", "payouts"]
dummy_connector = []
v1 = ["hyperswitch_domain_models/v1", "api_models/v1", "common_utils/v1"]
v2 =... | 470 |
hyperswitch | crates/hyperswitch_interfaces/README.md | .md | # Hyperswitch Interfaces
This crate includes interfaces and its error types
| 15 |
hyperswitch | crates/hyperswitch_interfaces/src/metrics.rs | .rs | //! Metrics interface
use router_env::{counter_metric, global_meter};
global_meter!(GLOBAL_METER, "ROUTER_API");
counter_metric!(UNIMPLEMENTED_FLOW, GLOBAL_METER);
| 38 |
hyperswitch | crates/hyperswitch_interfaces/src/disputes.rs | .rs | //! Disputes interface
use time::PrimitiveDateTime;
/// struct DisputePayload
#[derive(Default, Debug)]
pub struct DisputePayload {
/// amount
pub amount: String,
/// currency
pub currency: common_enums::enums::Currency,
/// dispute_stage
pub dispute_stage: common_enums::enums::DisputeStage,
... | 180 |
hyperswitch | crates/hyperswitch_interfaces/src/api.rs | .rs | //! API interface
/// authentication module
pub mod authentication;
/// authentication_v2 module
pub mod authentication_v2;
pub mod disputes;
pub mod disputes_v2;
pub mod files;
pub mod files_v2;
#[cfg(feature = "frm")]
pub mod fraud_check;
#[cfg(feature = "frm")]
pub mod fraud_check_v2;
pub mod payments;
pub mod paym... | 4,563 |
hyperswitch | crates/hyperswitch_interfaces/src/authentication.rs | .rs | //! Authentication interface
/// struct ExternalAuthenticationPayload
#[derive(Clone, serde::Deserialize, Debug, serde::Serialize, PartialEq, Eq)]
pub struct ExternalAuthenticationPayload {
/// trans_status
pub trans_status: common_enums::TransactionStatus,
/// authentication_value
pub authentication_v... | 78 |
hyperswitch | crates/hyperswitch_interfaces/src/encryption_interface.rs | .rs | //! Encryption related interface and error types
#![warn(missing_docs, missing_debug_implementations)]
use common_utils::errors::CustomResult;
/// Trait defining the interface for encryption management
#[async_trait::async_trait]
pub trait EncryptionManagementInterface: Sync + Send + dyn_clone::DynClone {
/// En... | 211 |
hyperswitch | crates/hyperswitch_interfaces/src/webhooks.rs | .rs | //! 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::{ExposeInterface, Secret};
use crate::{api::ConnectorCommon, errors};
... | 2,432 |
hyperswitch | crates/hyperswitch_interfaces/src/consts.rs | .rs | //! connector integration related const declarations
/// No error message string const
pub const NO_ERROR_MESSAGE: &str = "No error message";
/// No error code string const
pub const NO_ERROR_CODE: &str = "No error code";
/// Accepted format for request
pub const ACCEPT_HEADER: &str = "text/html,application/json";
... | 97 |
hyperswitch | crates/hyperswitch_interfaces/src/integrity.rs | .rs | use common_utils::errors::IntegrityCheckError;
use hyperswitch_domain_models::router_request_types::{
AuthoriseIntegrityObject, CaptureIntegrityObject, PaymentsAuthorizeData, PaymentsCaptureData,
PaymentsSyncData, RefundIntegrityObject, RefundsData, SyncIntegrityObject,
};
/// Connector Integrity trait to chec... | 2,208 |
hyperswitch | crates/hyperswitch_interfaces/src/conversion_impls.rs | .rs | use common_utils::{errors::CustomResult, id_type};
use error_stack::ResultExt;
#[cfg(feature = "frm")]
use hyperswitch_domain_models::router_data_v2::flow_common_types::FrmFlowData;
#[cfg(feature = "payouts")]
use hyperswitch_domain_models::router_data_v2::flow_common_types::PayoutFlowData;
use hyperswitch_domain_model... | 6,607 |
hyperswitch | crates/hyperswitch_interfaces/src/types.rs | .rs | //! Types interface
use hyperswitch_domain_models::{
router_data::AccessToken,
router_flow_types::{
access_token_auth::AccessTokenAuth,
dispute::{Accept, Defend, Evidence},
files::{Retrieve, Upload},
mandate_revoke::MandateRevoke,
payments::{
Authorize, Autho... | 2,675 |
hyperswitch | crates/hyperswitch_interfaces/src/secrets_interface.rs | .rs | //! Secrets management interface
pub mod secret_handler;
pub mod secret_state;
use common_utils::errors::CustomResult;
use masking::Secret;
/// Trait defining the interface for managing application secrets
#[async_trait::async_trait]
pub trait SecretManagementInterface: Send + Sync {
/*
/// Given an input, ... | 216 |
hyperswitch | crates/hyperswitch_interfaces/src/connector_integration_interface.rs | .rs | use api_models::webhooks::{IncomingWebhookEvent, ObjectReferenceId};
use common_enums::PaymentAction;
use common_utils::{crypto, errors::CustomResult, request::Request};
use hyperswitch_domain_models::{
api::ApplicationResponse,
configs::Connectors,
errors::api_error_response::ApiErrorResponse,
payment_... | 5,523 |
hyperswitch | crates/hyperswitch_interfaces/src/lib.rs | .rs | //! Hyperswitch interface
#![warn(missing_docs, missing_debug_implementations)]
pub mod api;
pub mod authentication;
/// Configuration related functionalities
pub mod configs;
/// Connector integration interface module
pub mod connector_integration_interface;
/// definition of the new connector integration trait
pub m... | 129 |
hyperswitch | crates/hyperswitch_interfaces/src/errors.rs | .rs | //! Errors interface
use common_utils::errors::ErrorSwitch;
use hyperswitch_domain_models::errors::api_error_response::ApiErrorResponse;
/// Connector Errors
#[allow(missing_docs, missing_debug_implementations)]
#[derive(Debug, thiserror::Error, PartialEq)]
pub enum ConnectorError {
#[error("Error while obtaining... | 1,342 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.