Skip to content

Commit 4b64c56

Browse files
refactor(router): [Nexi nets] Remove Default Case Handling (#2639)
1 parent 58085a3 commit 4b64c56

File tree

1 file changed

+57
-9
lines changed

1 file changed

+57
-9
lines changed

crates/router/src/connector/nexinets/transformers.rs

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use url::Url;
99

1010
use crate::{
1111
connector::utils::{
12-
CardData, PaymentsAuthorizeRequestData, PaymentsCancelRequestData, WalletData,
12+
self, CardData, PaymentsAuthorizeRequestData, PaymentsCancelRequestData, WalletData,
1313
},
1414
consts,
1515
core::errors,
@@ -597,12 +597,35 @@ fn get_payment_details_and_product(
597597
api_models::payments::BankRedirectData::Sofort { .. } => {
598598
Ok((None, NexinetsProduct::Sofort))
599599
}
600-
_ => Err(errors::ConnectorError::NotImplemented(
601-
"Payment methods".to_string(),
602-
))?,
600+
api_models::payments::BankRedirectData::BancontactCard { .. }
601+
| api_models::payments::BankRedirectData::Blik { .. }
602+
| api_models::payments::BankRedirectData::Bizum { .. }
603+
| api_models::payments::BankRedirectData::Interac { .. }
604+
| api_models::payments::BankRedirectData::OnlineBankingCzechRepublic { .. }
605+
| api_models::payments::BankRedirectData::OnlineBankingFinland { .. }
606+
| api_models::payments::BankRedirectData::OnlineBankingPoland { .. }
607+
| api_models::payments::BankRedirectData::OnlineBankingSlovakia { .. }
608+
| api_models::payments::BankRedirectData::OpenBankingUk { .. }
609+
| api_models::payments::BankRedirectData::Przelewy24 { .. }
610+
| api_models::payments::BankRedirectData::Trustly { .. }
611+
| api_models::payments::BankRedirectData::OnlineBankingFpx { .. }
612+
| api_models::payments::BankRedirectData::OnlineBankingThailand { .. } => {
613+
Err(errors::ConnectorError::NotImplemented(
614+
utils::get_unimplemented_payment_method_error_message("nexinets"),
615+
))?
616+
}
603617
},
604-
_ => Err(errors::ConnectorError::NotImplemented(
605-
"Payment methods".to_string(),
618+
PaymentMethodData::CardRedirect(_)
619+
| PaymentMethodData::PayLater(_)
620+
| PaymentMethodData::BankDebit(_)
621+
| PaymentMethodData::BankTransfer(_)
622+
| PaymentMethodData::Crypto(_)
623+
| PaymentMethodData::MandatePayment
624+
| PaymentMethodData::Reward
625+
| PaymentMethodData::Upi(_)
626+
| PaymentMethodData::Voucher(_)
627+
| PaymentMethodData::GiftCard(_) => Err(errors::ConnectorError::NotImplemented(
628+
utils::get_unimplemented_payment_method_error_message("nexinets"),
606629
))?,
607630
}
608631
}
@@ -677,9 +700,34 @@ fn get_wallet_details(
677700
))),
678701
NexinetsProduct::Applepay,
679702
)),
680-
_ => Err(errors::ConnectorError::NotImplemented(
681-
"Payment methods".to_string(),
682-
))?,
703+
api_models::payments::WalletData::AliPayQr(_)
704+
| api_models::payments::WalletData::AliPayRedirect(_)
705+
| api_models::payments::WalletData::AliPayHkRedirect(_)
706+
| api_models::payments::WalletData::MomoRedirect(_)
707+
| api_models::payments::WalletData::KakaoPayRedirect(_)
708+
| api_models::payments::WalletData::GoPayRedirect(_)
709+
| api_models::payments::WalletData::GcashRedirect(_)
710+
| api_models::payments::WalletData::ApplePayRedirect(_)
711+
| api_models::payments::WalletData::ApplePayThirdPartySdk(_)
712+
| api_models::payments::WalletData::DanaRedirect { .. }
713+
| api_models::payments::WalletData::GooglePay(_)
714+
| api_models::payments::WalletData::GooglePayRedirect(_)
715+
| api_models::payments::WalletData::GooglePayThirdPartySdk(_)
716+
| api_models::payments::WalletData::MbWayRedirect(_)
717+
| api_models::payments::WalletData::MobilePayRedirect(_)
718+
| api_models::payments::WalletData::PaypalSdk(_)
719+
| api_models::payments::WalletData::SamsungPay(_)
720+
| api_models::payments::WalletData::TwintRedirect { .. }
721+
| api_models::payments::WalletData::VippsRedirect { .. }
722+
| api_models::payments::WalletData::TouchNGoRedirect(_)
723+
| api_models::payments::WalletData::WeChatPayRedirect(_)
724+
| api_models::payments::WalletData::WeChatPayQr(_)
725+
| api_models::payments::WalletData::CashappQr(_)
726+
| api_models::payments::WalletData::SwishQr(_) => {
727+
Err(errors::ConnectorError::NotImplemented(
728+
utils::get_unimplemented_payment_method_error_message("nexinets"),
729+
))?
730+
}
683731
}
684732
}
685733

0 commit comments

Comments
 (0)