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] Fix response deserialization for vault id creation (#3166)

Sakil Mostakd44daaf53902
diff --git a/crates/router/src/connector/nmi/transformers.rs b/crates/router/src/connector/nmi/transformers.rs
index b0403d11e3..5dfcdcf8b9 100644
--- a/crates/router/src/connector/nmi/transformers.rs
+++ b/crates/router/src/connector/nmi/transformers.rs
@@ -129,7 +129,7 @@ fn get_card_details(
pub struct NmiVaultResponse {
pub response: Response,
pub responsetext: String,
- pub customer_vault_id: String,
+ pub customer_vault_id: Option<String>,
pub response_code: String,
}
@@ -178,7 +178,11 @@ impl
)?
.to_string(),
currency: currency_data,
- customer_vault_id: item.response.customer_vault_id,
+ customer_vault_id: item.response.customer_vault_id.ok_or(
+ errors::ConnectorError::MissingRequiredField {
+ field_name: "customer_vault_id",
+ },
+ )?,
public_key: auth_type.public_key.ok_or(
errors::ConnectorError::InvalidConnectorConfig {
config: "public_key",