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): [Noon] Use connector_response_reference_id as reference (#2442)

Sudharsan GS688557ef9582
diff --git a/crates/router/src/connector/noon/transformers.rs b/crates/router/src/connector/noon/transformers.rs
index d7dc832b44..6c3084a75e 100644
--- a/crates/router/src/connector/noon/transformers.rs
+++ b/crates/router/src/connector/noon/transformers.rs
@@ -356,6 +356,7 @@ pub struct NoonPaymentsOrderResponse {
id: u64,
error_code: u64,
error_message: Option<String>,
+ reference: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
@@ -410,14 +411,20 @@ impl<F, T>
reason: Some(error_message),
status_code: item.http_code,
}),
- _ => Ok(types::PaymentsResponseData::TransactionResponse {
- resource_id: types::ResponseId::ConnectorTransactionId(order.id.to_string()),
- redirection_data,
- mandate_reference,
- connector_metadata: None,
- network_txn_id: None,
- connector_response_reference_id: None,
- }),
+ _ => {
+ let connector_response_reference_id =
+ order.reference.or(Some(order.id.to_string()));
+ Ok(types::PaymentsResponseData::TransactionResponse {
+ resource_id: types::ResponseId::ConnectorTransactionId(
+ order.id.to_string(),
+ ),
+ redirection_data,
+ mandate_reference,
+ connector_metadata: None,
+ network_txn_id: None,
+ connector_response_reference_id,
+ })
+ }
},
..item.data
})
@@ -660,6 +667,7 @@ impl From<NoonWebhookObject> for NoonPaymentsResponse {
//For successful payments Noon Always populates error_code as 0.
error_code: 0,
error_message: None,
+ reference: None,
},
checkout_data: None,
subscription: None,