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): [Cybersource] Use connector_request_reference_id as reference to the connector (#2512)

Sahal Saad81cb8da4d47f
diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs
index 3558f75284..5a3060f99e 100644
--- a/crates/router/src/connector/cybersource/transformers.rs
+++ b/crates/router/src/connector/cybersource/transformers.rs
@@ -21,6 +21,7 @@ pub struct CybersourcePaymentsRequest {
processing_information: ProcessingInformation,
payment_information: PaymentInformation,
order_information: OrderInformationWithBill,
+ client_reference_information: ClientReferenceInformation,
}
#[derive(Default, Debug, Serialize, Eq, PartialEq)]
@@ -150,10 +151,15 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for CybersourcePaymentsRequest
capture_options: None,
};
+ let client_reference_information = ClientReferenceInformation {
+ code: Some(item.connector_request_reference_id.clone()),
+ };
+
Ok(Self {
processing_information,
payment_information,
order_information,
+ client_reference_information,
})
}
_ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()),
@@ -179,6 +185,9 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for CybersourcePaymentsRequest {
},
..Default::default()
},
+ client_reference_information: ClientReferenceInformation {
+ code: Some(value.connector_request_reference_id.clone()),
+ },
..Default::default()
})
}
@@ -195,6 +204,9 @@ impl TryFrom<&types::RefundExecuteRouterData> for CybersourcePaymentsRequest {
},
..Default::default()
},
+ client_reference_information: ClientReferenceInformation {
+ code: Some(value.connector_request_reference_id.clone()),
+ },
..Default::default()
})
}
@@ -278,7 +290,7 @@ pub struct CybersourcePaymentsResponse {
client_reference_information: Option<ClientReferenceInformation>,
}
-#[derive(Default, Debug, Clone, Deserialize, Eq, PartialEq)]
+#[derive(Default, Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ClientReferenceInformation {
code: Option<String>,