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(core): Added auth type field in UCS repeat payment request (#13233)

Shubhodip pal8ccbb1e44ff1
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 3a0a19e00d..0e3175f597 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -2294,7 +2294,8 @@ impl
payments_grpc::AdditionalPaymentData::foreign_from(additional_payment_data)
});
- let auth_type = payments_grpc::AuthenticationType::foreign_try_from(router_data.auth_type)?;
+ let auth_type = payments_grpc::AuthenticationType::foreign_try_from(router_data.auth_type)
+ .attach_printable("Failed to convert authentication type")?;
Ok(Self {
split_payments: router_data
@@ -3057,6 +3058,9 @@ impl
.map(|id| router_request_types::ResponseId::ConnectorTransactionId(id.clone()))
.unwrap_or(router_request_types::ResponseId::NoResponseId);
+ let connector_response_reference_id =
+ Some(response.merchant_recurring_payment_id.clone()).filter(|id| !id.is_empty());
+
let status_code = convert_connector_service_status_code(response.status_code)?;
let response = if let Some(error_info) = response.error.as_ref() {
@@ -3096,10 +3100,7 @@ impl
status_code,
attempt_status,
connector_transaction_id: connector_transaction_id.get_optional_response_id(),
- connector_response_reference_id: Some(
- response.merchant_recurring_payment_id.clone(),
- )
- .filter(|s| !s.is_empty()),
+ connector_response_reference_id: connector_response_reference_id.clone(),
network_decline_code: error_info.issuer_details.as_ref().and_then(|id| {
id.network_details
.as_ref()
@@ -3149,7 +3150,7 @@ impl
connector_metadata,
network_txn_id: response.network_transaction_id,
network_txn_link_id: None,
- connector_response_reference_id: Some(response.merchant_recurring_payment_id.clone()),
+ connector_response_reference_id,
incremental_authorization_allowed: response.incremental_authorization_allowed,
authentication_data: None,
charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,
@@ -3268,7 +3269,7 @@ impl
connector_response_reference_id: response.merchant_charge_id.clone(),
incremental_authorization_allowed: response.incremental_authorization_allowed,
authentication_data: None,
- charges: None,
+ charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,
},
status,
))