Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(wasm): add webhook URL type for mTLS connectors (#15268)

Sayak Bhattacharya526a6fd2511d
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs
index 01879dd70a..169a52aea5 100644
--- a/crates/connector_configs/src/connector.rs
+++ b/crates/connector_configs/src/connector.rs
@@ -246,6 +246,19 @@ pub struct ConnectorWebhookRegisterDetailsConfig {
pub event_types: Option<Vec<String>>,
}
+/// Determines which Hyperswitch webhook endpoint a connector should use.
+/// Dashboard uses this to show the mTLS callback URL only for connectors that
+/// verify incoming webhook requests with mTLS.
+#[derive(Debug, Clone, Copy, Default, Deserialize, Serialize, PartialEq, Eq)]
+#[serde(rename_all = "snake_case")]
+pub enum WebhookUrlType {
+ /// Standard webhook endpoint.
+ #[default]
+ NonMtls,
+ /// mTLS-enabled webhook endpoint.
+ Mtls,
+}
+
/// Wallet flow, based on who decrypts the wallet token
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
@@ -271,6 +284,8 @@ pub struct PayViaSingleUseTokenInputData {
pub struct ConnectorTomlConfig {
pub connector_auth: Option<ConnectorAuthType>,
pub connector_webhook_details: Option<api_models::admin::MerchantConnectorWebhookDetails>,
+ #[serde(default)]
+ pub webhook_url_type: WebhookUrlType,
pub metadata: Option<Box<ConfigMetadata>>,
pub connector_wallets_details: Option<Box<ConnectorWalletDetailsConfig>>,
pub connector_webhook_register_details: Option<ConnectorWebhookRegisterDetailsConfig>,
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index d76cb71ee6..e88fb54725 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -6463,6 +6463,7 @@ key1="Client Id"
api_key="Client Secret"
[santander_payout]
+webhook_url_type="mtls"
[[santander_payout.bank_transfer]]
payment_method_type = "pix"
[[santander_payout.bank_transfer]]
@@ -7707,6 +7708,7 @@ type = "Text"
type="Text"
[worldpayxml]
+webhook_url_type="mtls"
[[worldpayxml.credit]]
payment_method_type = "Mastercard"
[[worldpayxml.credit]]
@@ -7895,6 +7897,7 @@ api_key="API Username"
key1="API Password"
[worldpayxml_payout]
+webhook_url_type="mtls"
[[worldpayxml_payout.wallet]]
payment_method_type = "apple_pay"
[[worldpayxml_payout.wallet]]
@@ -7971,6 +7974,7 @@ type="Select"
options=[]
[santander]
+webhook_url_type="mtls"
[[santander.bank_transfer]]
payment_method_type = "pix_qr"
[[santander.bank_transfer]]
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index b7dbf45432..1a5364f296 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -4090,6 +4090,7 @@ api_secret="Certificates"
key2="Certificate Key"
[santander_payout]
+webhook_url_type="mtls"
[[santander_payout.bank_transfer]]
payment_method_type = "pix"
[[santander_payout.bank_transfer]]
@@ -6678,6 +6679,7 @@ type = "Text"
type="Text"
[worldpayxml]
+webhook_url_type="mtls"
[[worldpayxml.credit]]
payment_method_type = "Mastercard"
[[worldpayxml.credit]]
@@ -6864,6 +6866,7 @@ required=false
type="Text"
[worldpayxml_payout]
+webhook_url_type="mtls"
[[worldpayxml_payout.wallet]]
payment_method_type = "apple_pay"
[[worldpayxml_payout.wallet]]
@@ -6986,6 +6989,7 @@ required = false
type = "Text"
[santander]
+webhook_url_type="mtls"
[[santander.bank_transfer]]
payment_method_type = "pix_qr"
[[santander.bank_transfer]]
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index 9228d7dac5..e8a62b32a6 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -6425,6 +6425,7 @@ key1="Client Id"
api_key="Client Secret"
[santander_payout]
+webhook_url_type="mtls"
[[santander_payout.bank_transfer]]
payment_method_type = "pix"
[[santander_payout.bank_transfer]]
@@ -7684,6 +7685,7 @@ type = "Text"
type="Text"
[worldpayxml]
+webhook_url_type="mtls"
[[worldpayxml.credit]]
payment_method_type = "Mastercard"
[[worldpayxml.credit]]
@@ -7870,6 +7872,7 @@ required=false
type="Text"
[worldpayxml_payout]
+webhook_url_type="mtls"
[[worldpayxml_payout.wallet]]
payment_method_type = "apple_pay"
[[worldpayxml_payout.wallet]]
@@ -7946,6 +7949,7 @@ type = "Select"
options = []
[santander]
+webhook_url_type="mtls"
[[santander.bank_transfer]]
payment_method_type = "pix_qr"
[[santander.bank_transfer]]