Skip to content

Commit

Permalink
feat(connector): [RISKIFIED] Add support for riskified frm connector (#…
Browse files Browse the repository at this point in the history
…2533)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kashif <[email protected]>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Jagan <[email protected]>
  • Loading branch information
5 people authored Dec 12, 2023
1 parent 62a7c30 commit 151a30f
Show file tree
Hide file tree
Showing 58 changed files with 1,646 additions and 61 deletions.
1 change: 1 addition & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ placetopay.base_url = "https://api-co-dev.placetopay.ws/gateway"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
riskified.base_url = "https://sandbox.riskified.com/api"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
Expand Down
1 change: 1 addition & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ placetopay.base_url = "https://api-co-dev.placetopay.ws/gateway"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
riskified.base_url = "https://sandbox.riskified.com/api"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
Expand Down
1 change: 1 addition & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ placetopay.base_url = "https://api-co-dev.placetopay.ws/gateway"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
riskified.base_url = "https://sandbox.riskified.com/api"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
Expand Down
3 changes: 3 additions & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub enum Connector {
Zen,
Signifyd,
Plaid,
Riskified,
}

impl Connector {
Expand Down Expand Up @@ -200,13 +201,15 @@ impl From<PayoutConnectors> for RoutableConnectors {
pub enum FrmConnectors {
/// Signifyd Risk Manager. Official docs: https://docs.signifyd.com/
Signifyd,
Riskified,
}

#[cfg(feature = "frm")]
impl From<FrmConnectors> for RoutableConnectors {
fn from(value: FrmConnectors) -> Self {
match value {
FrmConnectors::Signifyd => Self::Signifyd,
FrmConnectors::Riskified => Self::Riskified,
}
}
}
Expand Down
35 changes: 35 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ pub struct PaymentsRequest {

///Request for an incremental authorization
pub request_incremental_authorization: Option<bool>,

/// additional data related to some frm connectors
pub frm_metadata: Option<serde_json::Value>,
}

impl PaymentsRequest {
Expand Down Expand Up @@ -2598,8 +2601,30 @@ pub struct OrderDetailsWithAmount {
pub quantity: u16,
/// the amount per quantity of product
pub amount: i64,
// Does the order includes shipping
pub requires_shipping: Option<bool>,
/// The image URL of the product
pub product_img_link: Option<String>,
/// ID of the product that is being purchased
pub product_id: Option<String>,
/// Category of the product that is being purchased
pub category: Option<String>,
/// Brand of the product that is being purchased
pub brand: Option<String>,
/// Type of the product that is being purchased
pub product_type: Option<ProductType>,
}

#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum ProductType {
#[default]
Physical,
Digital,
Travel,
Ride,
Event,
Accommodation,
}

#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
Expand All @@ -2610,8 +2635,18 @@ pub struct OrderDetails {
/// The quantity of the product to be purchased
#[schema(example = 1)]
pub quantity: u16,
// Does the order include shipping
pub requires_shipping: Option<bool>,
/// The image URL of the product
pub product_img_link: Option<String>,
/// ID of the product that is being purchased
pub product_id: Option<String>,
/// Category of the product that is being purchased
pub category: Option<String>,
/// Brand of the product that is being purchased
pub brand: Option<String>,
/// Type of the product that is being purchased
pub product_type: Option<ProductType>,
}

#[derive(Default, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
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 {
Powertranz,
Prophetpay,
Rapyd,
Riskified,
Shift4,
Signifyd,
Square,
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/configs/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ pub struct Connectors {
pub powertranz: ConnectorParams,
pub prophetpay: ConnectorParams,
pub rapyd: ConnectorParams,
pub riskified: ConnectorParams,
pub shift4: ConnectorParams,
pub signifyd: ConnectorParams,
pub square: ConnectorParams,
Expand Down
8 changes: 5 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 placetopay;
pub mod powertranz;
pub mod prophetpay;
pub mod rapyd;
pub mod riskified;
pub mod shift4;
pub mod signifyd;
pub mod square;
Expand All @@ -65,7 +66,8 @@ 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, placetopay::Placetopay,
powertranz::Powertranz, 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,
powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, riskified::Riskified,
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

0 comments on commit 151a30f

Please sign in to comment.