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(connector): add threedsecureio three_ds authentication connector #4004

Merged
merged 28 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
109e34a
feat(core): separate authentication related schema changes for existi…
hrithikesh026 Feb 29, 2024
f2034c4
Merge branch 'main' into authn-schema-changes-for-other-tables
hrithikesh026 Mar 4, 2024
51edecc
chore: update Cargo.lock
hyperswitch-bot[bot] Mar 4, 2024
3b699a6
fix: authentication_connector_details to business_profile from mercha…
hrithikesh026 Mar 4, 2024
2ea66d8
Merge branch 'main' into authn-schema-changes-for-other-tables
hrithikesh026 Mar 4, 2024
2e61580
chore: address cargo hack failure
hrithikesh026 Mar 4, 2024
95f5c0f
Merge branch 'main' into authn-schema-changes-for-other-tables
hrithikesh026 Mar 5, 2024
5d6c48c
add other prerequisites for 3ds external authentication
sai-harsha-vardhan Mar 5, 2024
fb9eaf1
resolve conflicts
sai-harsha-vardhan Mar 5, 2024
b7e73cf
feat(core): add core functions for external authentication
hrithikesh026 Mar 5, 2024
1d9d51d
resolve conflicts
sai-harsha-vardhan Mar 6, 2024
d0635d6
merge latest main
sai-harsha-vardhan Mar 6, 2024
05de19c
add payments authentication api flow
sai-harsha-vardhan Mar 6, 2024
915946a
Merge branch 'add-other-prerequisites-for-external-authn' into core-m…
sai-harsha-vardhan Mar 6, 2024
3c8713d
Merge branch 'main' into add-other-prerequisites-for-external-authn
sai-harsha-vardhan Mar 6, 2024
5526eab
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Mar 6, 2024
da51b0b
Merge branch 'add-other-prerequisites-for-external-authn' into core-m…
sai-harsha-vardhan Mar 6, 2024
9ef3cb2
Merge branch 'core-modules-for-external-authn' into add-new-payment-a…
sai-harsha-vardhan Mar 6, 2024
a9c973a
add threedsecureio connector
sai-harsha-vardhan Mar 7, 2024
57a1985
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Mar 7, 2024
7f1e54e
chore: update Cargo.lock
hyperswitch-bot[bot] Mar 7, 2024
004d4e6
remove unnecessary changes in connector flows
sai-harsha-vardhan Mar 7, 2024
ee8d4bd
add authn connector data
sai-harsha-vardhan Mar 7, 2024
4fbd173
fix clippy issues
sai-harsha-vardhan Mar 7, 2024
fd419e5
resolve comments
sai-harsha-vardhan Mar 8, 2024
3a069a1
resolve conflicts
sai-harsha-vardhan Mar 8, 2024
e4a9c35
make billing fields secret
sai-harsha-vardhan Mar 8, 2024
6fbce12
resolve conflicts
sai-harsha-vardhan Mar 9, 2024
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
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
stripe.base_url = "https://api.stripe.com/"
threedsecureio.base_url = "https://service.sandbox.3dsecure.io"
stripe.base_url_file_upload = "https://files.stripe.com/"
trustpay.base_url = "https://test-tpgw.trustpay.eu/"
trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/"
Expand Down Expand Up @@ -273,6 +274,7 @@ cards = [
"square",
"stax",
"stripe",
"threedsecureio",
"worldpay",
"zen",
]
Expand Down
2 changes: 2 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ cards = [
"square",
"stax",
"stripe",
"threedsecureio",
"trustpay",
"tsys",
"volt",
Expand Down Expand Up @@ -210,6 +211,7 @@ square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
stripe.base_url = "https://api.stripe.com/"
threedsecureio.base_url = "https://service.sandbox.3dsecure.io"
stripe.base_url_file_upload = "https://files.stripe.com/"
wise.base_url = "https://api.sandbox.transferwise.tech/"
worldline.base_url = "https://eu.sandbox.api-ingenico.com/"
Expand Down
2 changes: 2 additions & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
stripe.base_url = "https://api.stripe.com/"
threedsecureio.base_url = "https://service.sandbox.3dsecure.io"
stripe.base_url_file_upload = "https://files.stripe.com/"
trustpay.base_url = "https://test-tpgw.trustpay.eu/"
trustpay.base_url_bank_redirects = "https://aapi.trustpay.eu/"
Expand Down Expand Up @@ -211,6 +212,7 @@ cards = [
"square",
"stax",
"stripe",
"threedsecureio",
"trustpay",
"tsys",
"volt",
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pub enum Connector {
Square,
Stax,
Stripe,
Threedsecureio,
Trustpay,
// Tsys,
Tsys,
Expand Down
19 changes: 18 additions & 1 deletion crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use std::collections::HashMap;

#[cfg(feature = "payouts")]
use api_models::enums::PayoutConnectors;
use api_models::{enums::Connector, payments};
use api_models::{
enums::{AuthenticationConnectors, Connector},
payments,
};
use serde::Deserialize;
#[cfg(any(feature = "sandbox", feature = "development", feature = "production"))]
use toml;
Expand Down Expand Up @@ -75,6 +78,9 @@ pub struct ConfigMetadata {
pub apple_pay: Option<ApplePayTomlConfig>,
pub merchant_id: Option<String>,
pub endpoint_prefix: Option<String>,
pub mcc: Option<String>,
pub merchant_country_code: Option<String>,
pub merchant_name: Option<String>,
}

#[serde_with::skip_serializing_none]
Expand Down Expand Up @@ -147,6 +153,7 @@ pub struct ConnectorConfig {
pub stripe: Option<ConnectorTomlConfig>,
pub signifyd: Option<ConnectorTomlConfig>,
pub trustpay: Option<ConnectorTomlConfig>,
pub threedsecureio: Option<ConnectorTomlConfig>,
pub tsys: Option<ConnectorTomlConfig>,
pub volt: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
Expand Down Expand Up @@ -199,6 +206,15 @@ impl ConnectorConfig {
}
}

pub fn get_authentication_connector_config(
connector: AuthenticationConnectors,
) -> Result<Option<ConnectorTomlConfig>, String> {
let connector_data = Self::new()?;
match connector {
AuthenticationConnectors::Threedsecureio => Ok(connector_data.threedsecureio),
}
}

pub fn get_connector_config(
connector: Connector,
) -> Result<Option<ConnectorTomlConfig>, String> {
Expand Down Expand Up @@ -250,6 +266,7 @@ impl ConnectorConfig {
Connector::Stax => Ok(connector_data.stax),
Connector::Stripe => Ok(connector_data.stripe),
Connector::Trustpay => Ok(connector_data.trustpay),
Connector::Threedsecureio => Ok(connector_data.threedsecureio),
Connector::Tsys => Ok(connector_data.tsys),
Connector::Volt => Ok(connector_data.volt),
Connector::Wise => Err("Use get_payout_connector_config".to_string()),
Expand Down
10 changes: 9 additions & 1 deletion crates/connector_configs/toml/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2564,4 +2564,12 @@ key1 = "Adyen Account Id"
payment_method_type = "sepa"
[wise_payout.connector_auth.BodyKey]
api_key = "Wise API Key"
key1 = "Wise Account Id"
key1 = "Wise Account Id"

[threedsecureio]
[threedsecureio.connector_auth.HeaderKey]
api_key="Api Key"
[threedsecureio.metadata]
mcc="MCC"
merchant_country_code="3 digit numeric country code"
merchant_name="Name of the merchant"
10 changes: 9 additions & 1 deletion crates/connector_configs/toml/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2566,4 +2566,12 @@ key1 = "Adyen Account Id"
payment_method_type = "sepa"
[wise_payout.connector_auth.BodyKey]
api_key = "Wise API Key"
key1 = "Wise Account Id"
key1 = "Wise Account Id"

[threedsecureio]
[threedsecureio.connector_auth.HeaderKey]
api_key="Api Key"
[threedsecureio.metadata]
mcc="MCC"
merchant_country_code="3 digit numeric country code"
merchant_name="Name of the merchant"
8 changes: 8 additions & 0 deletions crates/euclid_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ pub fn get_payout_connector_config(key: &str) -> JsResult {
Ok(serde_wasm_bindgen::to_value(&res)?)
}

#[wasm_bindgen(js_name = getAuthenticationConnectorConfig)]
pub fn get_authentication_connector_config(key: &str) -> JsResult {
let key = api_model_enums::AuthenticationConnectors::from_str(key)
.map_err(|_| "Invalid key received".to_string())?;
let res = connector::ConnectorConfig::get_authentication_connector_config(key)?;
Ok(serde_wasm_bindgen::to_value(&res)?)
}

#[wasm_bindgen(js_name = getRequestPayload)]
pub fn get_request_payload(input: JsValue, response: JsValue) -> JsResult {
let input: DashboardRequestPayload = serde_wasm_bindgen::from_value(input)?;
Expand Down
2 changes: 2 additions & 0 deletions crates/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ openapi = { version = "0.1.0", path = "../openapi", optional = true }
erased-serde = "0.3.31"
quick-xml = { version = "0.31.0", features = ["serialize"] }
rdkafka = "0.36.0"
isocountry = "0.3.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary, As we are already using iso codes in our enum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is required to get numeric_id of the country

iso_currency = "0.4.4"
actix-http = "3.3.1"

[build-dependencies]
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 @@ -520,6 +520,7 @@ pub struct Connectors {
pub square: ConnectorParams,
pub stax: ConnectorParams,
pub stripe: ConnectorParamsWithFileUploadUrl,
pub threedsecureio: ConnectorParams,
pub trustpay: ConnectorParamsWithMoreUrls,
pub tsys: ConnectorParams,
pub volt: ConnectorParams,
Expand Down
5 changes: 3 additions & 2 deletions crates/router/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub mod signifyd;
pub mod square;
pub mod stax;
pub mod stripe;
pub mod threedsecureio;
pub mod trustpay;
pub mod tsys;
pub mod utils;
Expand All @@ -68,6 +69,6 @@ pub use self::{
payeezy::Payeezy, payme::Payme, paypal::Paypal, payu::Payu, placetopay::Placetopay,
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,
threedsecureio::Threedsecureio, trustpay::Trustpay, tsys::Tsys, volt::Volt, wise::Wise,
worldline::Worldline, worldpay::Worldpay, zen::Zen,
};
Loading
Loading