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(connector): [Datatrans] Google Pay / Apple Pay card-on-file mandate routing via UCS + feature matrix wallet entries (#14530)

Nithin Ne2f120b847b2
diff --git a/crates/hyperswitch_connectors/src/connectors/datatrans.rs b/crates/hyperswitch_connectors/src/connectors/datatrans.rs
index be17a17a8b..0fd259bf65 100644
--- a/crates/hyperswitch_connectors/src/connectors/datatrans.rs
+++ b/crates/hyperswitch_connectors/src/connectors/datatrans.rs
@@ -851,7 +851,7 @@ static DATATRANS_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
PaymentMethodDetails {
mandates: common_enums::enums::FeatureStatus::Supported,
refunds: common_enums::enums::FeatureStatus::Supported,
- supported_capture_methods,
+ supported_capture_methods: supported_capture_methods.clone(),
specific_features: Some(
api_models::feature_matrix::PaymentMethodSpecificFeatures::Card({
api_models::feature_matrix::CardSpecificFeatures {
@@ -864,6 +864,28 @@ static DATATRANS_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
},
);
+ datatrans_supported_payment_methods.add(
+ PaymentMethod::Wallet,
+ PaymentMethodType::GooglePay,
+ PaymentMethodDetails {
+ mandates: common_enums::enums::FeatureStatus::Supported,
+ refunds: common_enums::enums::FeatureStatus::Supported,
+ supported_capture_methods: supported_capture_methods.clone(),
+ specific_features: None,
+ },
+ );
+
+ datatrans_supported_payment_methods.add(
+ PaymentMethod::Wallet,
+ PaymentMethodType::ApplePay,
+ PaymentMethodDetails {
+ mandates: common_enums::enums::FeatureStatus::Supported,
+ refunds: common_enums::enums::FeatureStatus::Supported,
+ supported_capture_methods,
+ specific_features: None,
+ },
+ );
+
datatrans_supported_payment_methods
});
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index f58fe9e155..134c9b047f 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -1342,13 +1342,14 @@ impl ForeignFrom<&RouterData<PSync, PaymentsSyncData, PaymentsResponseData>>
_ => None,
}
});
-
let connector_mandate_id = structured
.and_then(|r| r.get_connector_mandate_id())
+ .or_else(|| router_data.request.connector_mandate_id.clone())
.or_else(|| router_data.connector_mandate_request_reference_id.clone());
let payment_method_id = structured.and_then(|r| r.get_payment_method_id());
- let connector_mandate_request_reference_id =
- structured.and_then(|r| r.get_connector_mandate_request_reference_id());
+ let connector_mandate_request_reference_id = structured
+ .and_then(|r| r.get_connector_mandate_request_reference_id())
+ .or_else(|| router_data.connector_mandate_request_reference_id.clone());
if connector_mandate_id.is_none()
&& payment_method_id.is_none()