Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement FRM flows #2968

Merged
merged 16 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
Expand Down Expand Up @@ -478,6 +479,9 @@ connection_timeout = 10 # Timeout for database connection in seconds
# TTL for KV in seconds
ttl = 900

[frm]
enabled = true

[paypal_onboarding]
client_id = "paypal_client_id" # Client ID for PayPal onboarding
client_secret = "paypal_secret_key" # Secret key for PayPal onboarding
Expand Down
4 changes: 4 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
Expand Down Expand Up @@ -476,6 +477,9 @@ delay_between_retries_in_milliseconds = 500
[kv_config]
ttl = 900 # 15 * 60 seconds

[frm]
enabled = true

[events]
source = "logs"

Expand Down
5 changes: 4 additions & 1 deletion config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
Expand Down Expand Up @@ -363,8 +364,10 @@ queue_strategy = "Fifo"
[kv_config]
ttl = 900 # 15 * 60 seconds

[frm]
enabled = true

[connector_onboarding.paypal]
client_id = ""
client_secret = ""
partner_id = ""
enabled = true
3 changes: 2 additions & 1 deletion crates/api_models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
license.workspace = true

[features]
default = ["payouts"]
default = ["payouts", "frm"]
business_profile_routing = []
connector_choice_bcompat = []
errors = ["dep:actix-web", "dep:reqwest"]
Expand All @@ -17,6 +17,7 @@ connector_choice_mca_id = ["euclid/connector_choice_mca_id"]
dummy_connector = ["euclid/dummy_connector", "common_enums/dummy_connector"]
detailed_errors = []
payouts = []
frm = []

[dependencies]
actix-web = { version = "4.3.1", optional = true }
Expand Down
30 changes: 30 additions & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,36 @@ impl From<PayoutConnectors> for RoutableConnectors {
}
}

#[cfg(feature = "frm")]
#[derive(
Clone,
Copy,
Debug,
Eq,
Hash,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
ToSchema,
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum FrmConnectors {
/// Signifyd Risk Manager. Official docs: https://docs.signifyd.com/
Signifyd,
}

#[cfg(feature = "frm")]
impl From<FrmConnectors> for RoutableConnectors {
fn from(value: FrmConnectors) -> Self {
match value {
FrmConnectors::Signifyd => Self::Signifyd,
}
}
}

#[derive(
Clone,
Copy,
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ pub enum RoutableConnectors {
Prophetpay,
Rapyd,
Shift4,
Signifyd,
Square,
Stax,
Stripe,
Expand Down
1 change: 1 addition & 0 deletions crates/common_utils/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub enum ApiEventsType {
// TODO: This has to be removed once the corresponding apiEventTypes are created
Miscellaneous,
RustLocker,
FraudCheck,
}

impl ApiEventMetric for serde_json::Value {}
Expand Down
3 changes: 2 additions & 1 deletion crates/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ readme = "README.md"
license.workspace = true

[features]
default = ["kv_store", "stripe", "oltp", "olap", "backwards_compatibility", "accounts_cache", "dummy_connector", "payouts", "profile_specific_fallback_routing", "retry"]
default = ["kv_store", "stripe", "oltp", "olap", "backwards_compatibility", "accounts_cache", "dummy_connector", "payouts", "profile_specific_fallback_routing", "retry", "frm"]
s3 = ["dep:aws-sdk-s3", "dep:aws-config"]
kms = ["external_services/kms", "dep:aws-config"]
email = ["external_services/email", "dep:aws-config", "olap"]
frm = []
basilisk = ["kms"]
stripe = ["dep:serde_qs"]
release = ["kms", "stripe", "basilisk", "s3", "email", "business_profile_routing", "accounts_cache", "kv_store", "profile_specific_fallback_routing"]
Expand Down
9 changes: 9 additions & 0 deletions crates/router/src/configs/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,21 @@ pub struct Settings {
pub analytics: AnalyticsConfig,
#[cfg(feature = "kv_store")]
pub kv_config: KvConfig,
#[cfg(feature = "frm")]
pub frm: Frm,
#[cfg(feature = "olap")]
pub report_download_config: ReportConfig,
pub events: EventsConfig,
#[cfg(feature = "olap")]
pub connector_onboarding: ConnectorOnboarding,
}

#[cfg(feature = "frm")]
#[derive(Debug, Deserialize, Clone, Default)]
pub struct Frm {
pub enabled: bool,
}

#[derive(Debug, Deserialize, Clone)]
pub struct KvConfig {
pub ttl: u32,
Expand Down Expand Up @@ -603,6 +611,7 @@ pub struct Connectors {
pub prophetpay: ConnectorParams,
pub rapyd: ConnectorParams,
pub shift4: ConnectorParams,
pub signifyd: ConnectorParams,
pub square: ConnectorParams,
pub stax: ConnectorParams,
pub stripe: ConnectorParamsWithFileUploadUrl,
Expand Down
7 changes: 4 additions & 3 deletions crates/router/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub mod powertranz;
pub mod prophetpay;
pub mod rapyd;
pub mod shift4;
pub mod signifyd;
pub mod square;
pub mod stax;
pub mod stripe;
Expand All @@ -63,7 +64,7 @@ pub use self::{
iatapay::Iatapay, klarna::Klarna, mollie::Mollie, multisafepay::Multisafepay,
nexinets::Nexinets, nmi::Nmi, noon::Noon, nuvei::Nuvei, opayo::Opayo, opennode::Opennode,
payeezy::Payeezy, payme::Payme, paypal::Paypal, payu::Payu, powertranz::Powertranz,
prophetpay::Prophetpay, rapyd::Rapyd, shift4::Shift4, square::Square, stax::Stax,
stripe::Stripe, trustpay::Trustpay, tsys::Tsys, volt::Volt, wise::Wise, worldline::Worldline,
worldpay::Worldpay, zen::Zen,
prophetpay::Prophetpay, rapyd::Rapyd, shift4::Shift4, signifyd::Signifyd, square::Square,
stax::Stax, stripe::Stripe, trustpay::Trustpay, tsys::Tsys, volt::Volt, wise::Wise,
worldline::Worldline, worldpay::Worldpay, zen::Zen,
};
Loading
Loading