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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
refactor(payment_methods): make the card_holder_name as an empty string if not sent (#3173)
Chethan Raob98e53d5cba5
diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rsindex 470c6705e1..e729eacf9d 100644--- a/crates/router/src/connector/aci/transformers.rs+++ b/crates/router/src/connector/aci/transformers.rs@@ -256,7 +256,7 @@ impl TryFrom<api_models::payments::Card> for PaymentDetails {card_number: card_data.card_number,card_holder: card_data.card_holder_name- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),card_expiry_month: card_data.card_exp_month,card_expiry_year: card_data.card_exp_year,card_cvv: card_data.card_cvc,diff --git a/crates/router/src/connector/bambora/transformers.rs b/crates/router/src/connector/bambora/transformers.rsindex 4729bfa5a6..8f18ca272d 100644--- a/crates/router/src/connector/bambora/transformers.rs+++ b/crates/router/src/connector/bambora/transformers.rs@@ -5,7 +5,7 @@ use masking::{PeekInterface, Secret};use serde::{Deserialize, Deserializer, Serialize};use crate::{- connector::utils::{self, BrowserInformationData, PaymentsAuthorizeRequestData},+ connector::utils::{BrowserInformationData, PaymentsAuthorizeRequestData},consts,core::errors,services,@@ -119,7 +119,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for BamboraPaymentsRequest {let bambora_card = BamboraCard {name: req_card.card_holder_name- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),number: req_card.card_number,expiry_month: req_card.card_exp_month,expiry_year: req_card.card_exp_year,diff --git a/crates/router/src/connector/braintree/braintree_graphql_transformers.rs b/crates/router/src/connector/braintree/braintree_graphql_transformers.rsindex d120130963..9bdbd4392f 100644--- a/crates/router/src/connector/braintree/braintree_graphql_transformers.rs+++ b/crates/router/src/connector/braintree/braintree_graphql_transformers.rs@@ -869,7 +869,7 @@ impl TryFrom<&types::TokenizationRouterData> for BraintreeTokenRequest {cvv: card_data.card_cvc,cardholder_name: card_data.card_holder_name- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),},};Ok(Self {diff --git a/crates/router/src/connector/dlocal/transformers.rs b/crates/router/src/connector/dlocal/transformers.rsindex 25462c758f..5eb682d4cf 100644--- a/crates/router/src/connector/dlocal/transformers.rs+++ b/crates/router/src/connector/dlocal/transformers.rs@@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};use url::Url;use crate::{- connector::utils::{self, AddressDetailsData, PaymentsAuthorizeRequestData, RouterData},+ connector::utils::{AddressDetailsData, PaymentsAuthorizeRequestData, RouterData},core::errors,services,types::{self, api, storage::enums},@@ -128,7 +128,7 @@ impl TryFrom<&DlocalRouterData<&types::PaymentsAuthorizeRouterData>> for DlocalPholder_name: ccard.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),number: ccard.card_number.clone(),cvv: ccard.card_cvc.clone(),expiration_month: ccard.card_exp_month.clone(),diff --git a/crates/router/src/connector/dummyconnector/transformers.rs b/crates/router/src/connector/dummyconnector/transformers.rsindex bbb3b10c8e..5c20d35358 100644--- a/crates/router/src/connector/dummyconnector/transformers.rs+++ b/crates/router/src/connector/dummyconnector/transformers.rs@@ -4,7 +4,6 @@ use serde::{Deserialize, Serialize};use url::Url;use crate::{- connector::utils,core::errors,services,types::{self, api, storage::enums},@@ -90,7 +89,7 @@ impl TryFrom<api_models::payments::Card> for DummyConnectorCard {Ok(Self {name: value.card_holder_name- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),number: value.card_number,expiry_month: value.card_exp_month,expiry_year: value.card_exp_year,diff --git a/crates/router/src/connector/forte/transformers.rs b/crates/router/src/connector/forte/transformers.rsindex ca7a66a9ff..4c770eb788 100644--- a/crates/router/src/connector/forte/transformers.rs+++ b/crates/router/src/connector/forte/transformers.rs@@ -83,7 +83,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for FortePaymentsRequest {name_on_card: ccard.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),account_number: ccard.card_number.clone(),expire_month: ccard.card_exp_month.clone(),expire_year: ccard.card_exp_year.clone(),diff --git a/crates/router/src/connector/mollie/transformers.rs b/crates/router/src/connector/mollie/transformers.rsindex c1151adcf6..5960e9cdb8 100644--- a/crates/router/src/connector/mollie/transformers.rs+++ b/crates/router/src/connector/mollie/transformers.rs@@ -289,7 +289,7 @@ impl TryFrom<&types::TokenizationRouterData> for MollieCardTokenRequest {let card_holder = ccard.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?;+ .unwrap_or(Secret::new("".to_string()));let card_number = ccard.card_number.clone();let card_expiry_date =ccard.get_card_expiry_month_year_2_digit_with_delimiter("/".to_owned());diff --git a/crates/router/src/connector/noon/transformers.rs b/crates/router/src/connector/noon/transformers.rsindex e2262e7b89..bbf284848b 100644--- a/crates/router/src/connector/noon/transformers.rs+++ b/crates/router/src/connector/noon/transformers.rs@@ -203,7 +203,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NoonPaymentsRequest {name_on_card: req_card.card_holder_name.clone()- .ok_or_else(conn_utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),number_plain: req_card.card_number.clone(),expiry_month: req_card.card_exp_month.clone(),expiry_year: req_card.get_expiry_year_4_digit(),diff --git a/crates/router/src/connector/opayo/transformers.rs b/crates/router/src/connector/opayo/transformers.rsindex a0e3877f82..94ab62b4f7 100644--- a/crates/router/src/connector/opayo/transformers.rs+++ b/crates/router/src/connector/opayo/transformers.rs@@ -31,7 +31,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for OpayoPaymentsRequest {let card = OpayoCard {name: req_card.card_holder_name- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),number: req_card.card_number,expiry_month: req_card.card_exp_month,expiry_year: req_card.card_exp_year,diff --git a/crates/router/src/connector/payeezy/transformers.rs b/crates/router/src/connector/payeezy/transformers.rsindex 8b4f4a4695..7ae7feba68 100644--- a/crates/router/src/connector/payeezy/transformers.rs+++ b/crates/router/src/connector/payeezy/transformers.rs@@ -244,7 +244,7 @@ fn get_payment_method_data(cardholder_name: card.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),card_number: card.card_number.clone(),exp_date: card.get_card_expiry_month_year_2_digit_with_delimiter("".to_string()),cvv: card.card_cvc.clone(),diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rsindex 0871bc5097..9f7a359899 100644--- a/crates/router/src/connector/paypal/transformers.rs+++ b/crates/router/src/connector/paypal/transformers.rs@@ -446,7 +446,7 @@ impl TryFrom<&PaypalRouterData<&types::PaymentsAuthorizeRouterData>> for PaypalPname: ccard.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),number: Some(ccard.card_number.clone()),security_code: Some(ccard.card_cvc.clone()),attributes,diff --git a/crates/router/src/connector/powertranz/transformers.rs b/crates/router/src/connector/powertranz/transformers.rsindex 6d5a756c57..0054963320 100644--- a/crates/router/src/connector/powertranz/transformers.rs+++ b/crates/router/src/connector/powertranz/transformers.rs@@ -218,7 +218,7 @@ impl TryFrom<&Card> for Source {cardholder_name: card.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),card_pan: card.card_number.clone(),card_expiration: card.get_expiry_date_as_yymm(),card_cvv: card.card_cvc.clone(),diff --git a/crates/router/src/connector/rapyd/transformers.rs b/crates/router/src/connector/rapyd/transformers.rsindex aab47bc8b2..9fd664748e 100644--- a/crates/router/src/connector/rapyd/transformers.rs+++ b/crates/router/src/connector/rapyd/transformers.rs@@ -4,7 +4,7 @@ use time::PrimitiveDateTime;use url::Url;use crate::{- connector::utils::{self, PaymentsAuthorizeRequestData},+ connector::utils::PaymentsAuthorizeRequestData,consts,core::errors,pii::Secret,@@ -134,7 +134,7 @@ impl TryFrom<&RapydRouterData<&types::PaymentsAuthorizeRouterData>> for RapydPayname: ccard.card_holder_name.to_owned()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),cvv: ccard.card_cvc.to_owned(),}),address: None,diff --git a/crates/router/src/connector/shift4/transformers.rs b/crates/router/src/connector/shift4/transformers.rsindex 2b89e7ebf6..949082f425 100644--- a/crates/router/src/connector/shift4/transformers.rs+++ b/crates/router/src/connector/shift4/transformers.rs@@ -299,7 +299,7 @@ impl<T>cardholder_name: card.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),};if item.is_three_ds() {Ok(Self::Cards3DSRequest(Box::new(Cards3DSRequest {diff --git a/crates/router/src/connector/stax/transformers.rs b/crates/router/src/connector/stax/transformers.rsindex 7395172239..081be000cf 100644--- a/crates/router/src/connector/stax/transformers.rs+++ b/crates/router/src/connector/stax/transformers.rs@@ -228,7 +228,7 @@ impl TryFrom<&types::TokenizationRouterData> for StaxTokenRequest {.get_card_expiry_month_year_2_digit_with_delimiter("".to_string()),person_name: card_data.card_holder_name- .ok_or_else(missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),card_number: card_data.card_number,card_cvv: card_data.card_cvc,customer_id: Secret::new(customer_id),diff --git a/crates/router/src/connector/worldline/transformers.rs b/crates/router/src/connector/worldline/transformers.rsindex d9e9d1ff7c..b657756b6a 100644--- a/crates/router/src/connector/worldline/transformers.rs+++ b/crates/router/src/connector/worldline/transformers.rs@@ -354,7 +354,7 @@ fn make_card_request(cardholder_name: ccard.card_holder_name.clone()- .ok_or_else(utils::missing_field_err("card_holder_name"))?,+ .unwrap_or(Secret::new("".to_string())),cvv: ccard.card_cvc.clone(),expiry_date,};