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

refactor(connector): [NMI] Add billing details for preprocessing (#3672)

Sakil Mostak09d337b8a8d9
diff --git a/crates/router/src/connector/nmi/transformers.rs b/crates/router/src/connector/nmi/transformers.rs
index c6d763fe56..d4283a888a 100644
--- a/crates/router/src/connector/nmi/transformers.rs
+++ b/crates/router/src/connector/nmi/transformers.rs
@@ -1,5 +1,6 @@
use api_models::webhooks;
use cards::CardNumber;
+use common_enums::CountryAlpha2;
use common_utils::{errors::CustomResult, ext_traits::XmlExt, pii};
use error_stack::{IntoReport, Report, ResultExt};
use masking::{ExposeInterface, PeekInterface, Secret};
@@ -89,6 +90,12 @@ pub struct NmiVaultRequest {
cvv: Secret<String>,
first_name: Secret<String>,
last_name: Secret<String>,
+ address1: Option<Secret<String>>,
+ address2: Option<Secret<String>>,
+ city: Option<String>,
+ state: Option<Secret<String>>,
+ zip: Option<Secret<String>>,
+ country: Option<CountryAlpha2>,
customer_vault: CustomerAction,
}
@@ -113,6 +120,12 @@ impl TryFrom<&types::PaymentsPreProcessingRouterData> for NmiVaultRequest {
cvv,
first_name: billing_details.get_first_name()?.to_owned(),
last_name: billing_details.get_last_name()?.to_owned(),
+ address1: billing_details.line1.clone(),
+ address2: billing_details.line2.clone(),
+ city: billing_details.city.clone(),
+ state: billing_details.state.clone(),
+ country: billing_details.country,
+ zip: billing_details.zip.clone(),
customer_vault: CustomerAction::AddCustomer,
})
}