Skip to content

Commit

Permalink
feat(connector): [Noon] Use connector_response_reference_id as refere…
Browse files Browse the repository at this point in the history
…nce (#2442)
  • Loading branch information
sudharsangs authored Oct 4, 2023
1 parent 05ee47a commit 688557e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions crates/router/src/connector/noon/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ pub struct NoonPaymentsOrderResponse {
id: u64,
error_code: u64,
error_message: Option<String>,
reference: Option<String>,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -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
})
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 688557e

Please sign in to comment.