refactor(router): [Nexi nets] Remove Default Case Handling (#2639)

This commit is contained in:
Kumar Harshwardhan
2023-10-20 13:20:10 +05:30
committed by GitHub
parent 58085a392e
commit 4b64c56355

View File

@ -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"),
))?
}
}
}