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(connector): Nmi merchant_defined_fields are double encoded (#10603)

Nithin Nf8fa541cf3b6
diff --git a/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
index 80a9468ccb..da03f4990c 100644
--- a/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
@@ -469,7 +469,13 @@ impl NmiMerchantDefinedField {
.enumerate()
.map(|(index, (hs_key, hs_value))| {
let nmi_key = format!("merchant_defined_field_{}", index + 1);
- let nmi_value = format!("{hs_key}={hs_value}");
+ let val = match hs_value {
+ serde_json::Value::Bool(boolean) => boolean.to_string(),
+ serde_json::Value::Number(number) => number.to_string(),
+ serde_json::Value::String(string) => string.to_string(),
+ _ => hs_value.to_string(),
+ };
+ let nmi_value = format!("{hs_key}={val}");
(nmi_key, Secret::new(nmi_value))
})
.collect();