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(router): [Nexi nets] Remove Default Case Handling (#2639)

Kumar Harshwardhan4b64c563558d
diff --git a/crates/router/src/connector/nexinets/transformers.rs b/crates/router/src/connector/nexinets/transformers.rs
index 897d8f639d..2af3ee0a1b 100644
--- a/crates/router/src/connector/nexinets/transformers.rs
+++ b/crates/router/src/connector/nexinets/transformers.rs
@@ -9,7 +9,7 @@ use url::Url;
use crate::{
connector::utils::{
- CardData, PaymentsAuthorizeRequestData, PaymentsCancelRequestData, WalletData,
+ self, CardData, PaymentsAuthorizeRequestData, PaymentsCancelRequestData, WalletData,
},
consts,
core::errors,
@@ -597,12 +597,35 @@ fn get_payment_details_and_product(
api_models::payments::BankRedirectData::Sofort { .. } => {
Ok((None, NexinetsProduct::Sofort))
}
- _ => Err(errors::ConnectorError::NotImplemented(
- "Payment methods".to_string(),
- ))?,
+ api_models::payments::BankRedirectData::BancontactCard { .. }
+ | api_models::payments::BankRedirectData::Blik { .. }
+ | api_models::payments::BankRedirectData::Bizum { .. }
+ | api_models::payments::BankRedirectData::Interac { .. }
+ | api_models::payments::BankRedirectData::OnlineBankingCzechRepublic { .. }
+ | api_models::payments::BankRedirectData::OnlineBankingFinland { .. }
+ | api_models::payments::BankRedirectData::OnlineBankingPoland { .. }
+ | api_models::payments::BankRedirectData::OnlineBankingSlovakia { .. }
+ | api_models::payments::BankRedirectData::OpenBankingUk { .. }
+ | api_models::payments::BankRedirectData::Przelewy24 { .. }
+ | api_models::payments::BankRedirectData::Trustly { .. }
+ | api_models::payments::BankRedirectData::OnlineBankingFpx { .. }
+ | api_models::payments::BankRedirectData::OnlineBankingThailand { .. } => {
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("nexinets"),
+ ))?
+ }
},
- _ => Err(errors::ConnectorError::NotImplemented(
- "Payment methods".to_string(),
+ PaymentMethodData::CardRedirect(_)
+ | PaymentMethodData::PayLater(_)
+ | PaymentMethodData::BankDebit(_)
+ | PaymentMethodData::BankTransfer(_)
+ | PaymentMethodData::Crypto(_)
+ | PaymentMethodData::MandatePayment
+ | PaymentMethodData::Reward
+ | PaymentMethodData::Upi(_)
+ | PaymentMethodData::Voucher(_)
+ | PaymentMethodData::GiftCard(_) => Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("nexinets"),
))?,
}
}
@@ -677,9 +700,34 @@ fn get_wallet_details(
))),
NexinetsProduct::Applepay,
)),
- _ => Err(errors::ConnectorError::NotImplemented(
- "Payment methods".to_string(),
- ))?,
+ api_models::payments::WalletData::AliPayQr(_)
+ | api_models::payments::WalletData::AliPayRedirect(_)
+ | api_models::payments::WalletData::AliPayHkRedirect(_)
+ | api_models::payments::WalletData::MomoRedirect(_)
+ | api_models::payments::WalletData::KakaoPayRedirect(_)
+ | api_models::payments::WalletData::GoPayRedirect(_)
+ | api_models::payments::WalletData::GcashRedirect(_)
+ | api_models::payments::WalletData::ApplePayRedirect(_)
+ | api_models::payments::WalletData::ApplePayThirdPartySdk(_)
+ | api_models::payments::WalletData::DanaRedirect { .. }
+ | api_models::payments::WalletData::GooglePay(_)
+ | api_models::payments::WalletData::GooglePayRedirect(_)
+ | api_models::payments::WalletData::GooglePayThirdPartySdk(_)
+ | api_models::payments::WalletData::MbWayRedirect(_)
+ | api_models::payments::WalletData::MobilePayRedirect(_)
+ | api_models::payments::WalletData::PaypalSdk(_)
+ | api_models::payments::WalletData::SamsungPay(_)
+ | api_models::payments::WalletData::TwintRedirect { .. }
+ | api_models::payments::WalletData::VippsRedirect { .. }
+ | api_models::payments::WalletData::TouchNGoRedirect(_)
+ | api_models::payments::WalletData::WeChatPayRedirect(_)
+ | api_models::payments::WalletData::WeChatPayQr(_)
+ | api_models::payments::WalletData::CashappQr(_)
+ | api_models::payments::WalletData::SwishQr(_) => {
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("nexinets"),
+ ))?
+ }
}
}