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

refactor(connector): [trustpay] enable network tokenization for trustpay (#11399)

Pa1NarKbf39e8e8b686
diff --git a/config/config.example.toml b/config/config.example.toml
index 2e81315285..91a88cbc3c 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -1275,7 +1275,7 @@ webhook_source_verification_key= "" # webhook source verification key to verify
check_tokenize_eligibility_url="" # base url to check tokenization eligibility from token service
[network_tokenization_supported_connectors]
-connector_list = "adyen,cybersource,peachpayments" # Supported connectors for network tokenization
+connector_list = "adyen,cybersource,peachpayments,trustpay" # Supported connectors for network tokenization
[network_transaction_id_supported_connectors]
connector_list = "adyen,archipel,checkout,cybersource,novalnet,stripe,worldpay,worldpayvantiv" # Supported connectors for network transaction id
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index f3e2dd85e4..92bab54d03 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -966,7 +966,7 @@ connector_list = "tokenio"
card_networks = "Visa, AmericanExpress, Mastercard"
[network_tokenization_supported_connectors]
-connector_list = "adyen,cybersource,peachpayments"
+connector_list = "adyen,cybersource,peachpayments,trustpay"
[platform]
enabled = true
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 991ea58efe..92eb75eba6 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -981,7 +981,7 @@ connector_list = "tokenio"
card_networks = "Visa, AmericanExpress, Mastercard"
[network_tokenization_supported_connectors]
-connector_list = "adyen,cybersource,peachpayments"
+connector_list = "adyen,cybersource,peachpayments,trustpay"
[platform]
enabled = true
diff --git a/config/development.toml b/config/development.toml
index 2cfc064e44..f4984d5f8b 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -1398,7 +1398,7 @@ id = "12345"
card_networks = "Visa, AmericanExpress, Mastercard"
[network_tokenization_supported_connectors]
-connector_list = "adyen,cybersource,peachpayments"
+connector_list = "adyen,cybersource,peachpayments,trustpay"
[grpc_client.dynamic_routing_client]
host = "localhost"
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 2589463f68..3ac0ca7e75 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -1281,7 +1281,7 @@ id = "12345"
card_networks = "Visa, AmericanExpress, Mastercard"
[network_tokenization_supported_connectors]
-connector_list = "adyen,cybersource,peachpayments"
+connector_list = "adyen,cybersource,peachpayments,trustpay"
# EmailClient configuration. Only applicable when the `email` feature flag is enabled.
[email]
diff --git a/crates/hyperswitch_connectors/src/connectors/trustpay.rs b/crates/hyperswitch_connectors/src/connectors/trustpay.rs
index b0ae54e8b5..ceb2c37527 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustpay.rs
@@ -1306,7 +1306,7 @@ static TRUSTPAY_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
api_models::feature_matrix::CardSpecificFeatures {
three_ds: common_enums::FeatureStatus::NotSupported,
no_three_ds: common_enums::FeatureStatus::Supported,
- supported_card_networks: supported_card_network,
+ supported_card_networks: supported_card_network.clone(),
}
}),
),
@@ -1434,6 +1434,28 @@ static TRUSTPAY_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
},
);
+ trustpay_supported_payment_methods.add(
+ enums::PaymentMethod::NetworkToken,
+ enums::PaymentMethodType::NetworkToken,
+ PaymentMethodDetails {
+ mandates: enums::FeatureStatus::NotSupported,
+ refunds: enums::FeatureStatus::Supported,
+ supported_capture_methods: vec![
+ enums::CaptureMethod::Automatic,
+ enums::CaptureMethod::SequentialAutomatic,
+ ],
+ specific_features: Some(
+ api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
+ api_models::feature_matrix::CardSpecificFeatures {
+ three_ds: common_enums::FeatureStatus::Supported,
+ no_three_ds: common_enums::FeatureStatus::Supported,
+ supported_card_networks: supported_card_network.clone(),
+ }
+ }),
+ ),
+ },
+ );
+
trustpay_supported_payment_methods
});