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

fix(core): If frm is not called, send None in frm_message instead of initial values in update tracker (#1867)

rishavkar3250204acc1e
diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs
index 9e8f9a6267..abf5693713 100644
--- a/crates/router/src/core/payments/operations/payment_status.rs
+++ b/crates/router/src/core/payments/operations/payment_status.rs
@@ -277,17 +277,25 @@ async fn get_tracker_for_sync<
.attach_printable_lazy(|| {
format!("Error while retrieving frm_response, merchant_id: {merchant_id}, payment_id: {payment_id_str}")
});
- let frm_message = frm_response
- .ok()
- .map(|response| api_models::payments::FrmMessage {
- frm_name: response.frm_name,
- frm_transaction_id: response.frm_transaction_id,
- frm_transaction_type: Some(response.frm_transaction_type.to_string()),
- frm_status: Some(response.frm_status.to_string()),
- frm_score: response.frm_score,
- frm_reason: response.frm_reason,
- frm_error: response.frm_error,
- });
+
+ let frm_message = match frm_response.ok() {
+ Some(response) => {
+ if response.frm_status.to_string() == "pending" {
+ None
+ } else {
+ Some(api_models::payments::FrmMessage {
+ frm_name: response.frm_name,
+ frm_transaction_id: response.frm_transaction_id,
+ frm_transaction_type: Some(response.frm_transaction_type.to_string()),
+ frm_status: Some(response.frm_status.to_string()),
+ frm_score: response.frm_score,
+ frm_reason: response.frm_reason,
+ frm_error: response.frm_error,
+ })
+ }
+ }
+ None => None,
+ };
let contains_encoded_data = connector_response.encoded_data.is_some();