mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
refactor(connector): [Shift4] change error message from NotSupported to NotImplemented (#2880)
This commit is contained in:
@ -168,10 +168,9 @@ impl<T> TryFrom<&types::RouterData<T, types::PaymentsAuthorizeData, types::Payme
|
||||
| payments::PaymentMethodData::Reward
|
||||
| payments::PaymentMethodData::Upi(_)
|
||||
| payments::PaymentMethodData::CardToken(_) => {
|
||||
Err(errors::ConnectorError::NotSupported {
|
||||
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
|
||||
connector: "Shift4",
|
||||
}
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
}
|
||||
@ -184,13 +183,8 @@ impl TryFrom<&api_models::payments::WalletData> for Shift4PaymentMethod {
|
||||
match wallet_data {
|
||||
payments::WalletData::AliPayRedirect(_)
|
||||
| payments::WalletData::ApplePay(_)
|
||||
| payments::WalletData::WeChatPayRedirect(_) => {
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
payments::WalletData::AliPayQr(_)
|
||||
| payments::WalletData::WeChatPayRedirect(_)
|
||||
| payments::WalletData::AliPayQr(_)
|
||||
| payments::WalletData::AliPayHkRedirect(_)
|
||||
| payments::WalletData::MomoRedirect(_)
|
||||
| payments::WalletData::KakaoPayRedirect(_)
|
||||
@ -212,10 +206,9 @@ impl TryFrom<&api_models::payments::WalletData> for Shift4PaymentMethod {
|
||||
| payments::WalletData::TouchNGoRedirect(_)
|
||||
| payments::WalletData::WeChatPayQr(_)
|
||||
| payments::WalletData::CashappQr(_)
|
||||
| payments::WalletData::SwishQr(_) => Err(errors::ConnectorError::NotSupported {
|
||||
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
|
||||
connector: "Shift4",
|
||||
}
|
||||
| payments::WalletData::SwishQr(_) => Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into()),
|
||||
}
|
||||
}
|
||||
@ -227,13 +220,8 @@ impl TryFrom<&api_models::payments::BankTransferData> for Shift4PaymentMethod {
|
||||
bank_transfer_data: &api_models::payments::BankTransferData,
|
||||
) -> Result<Self, Self::Error> {
|
||||
match bank_transfer_data {
|
||||
payments::BankTransferData::MultibancoBankTransfer { .. } => {
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
payments::BankTransferData::AchBankTransfer { .. }
|
||||
payments::BankTransferData::MultibancoBankTransfer { .. }
|
||||
| payments::BankTransferData::AchBankTransfer { .. }
|
||||
| payments::BankTransferData::SepaBankTransfer { .. }
|
||||
| payments::BankTransferData::BacsBankTransfer { .. }
|
||||
| payments::BankTransferData::PermataBankTransfer { .. }
|
||||
@ -244,10 +232,9 @@ impl TryFrom<&api_models::payments::BankTransferData> for Shift4PaymentMethod {
|
||||
| payments::BankTransferData::DanamonVaBankTransfer { .. }
|
||||
| payments::BankTransferData::MandiriVaBankTransfer { .. }
|
||||
| payments::BankTransferData::Pix {}
|
||||
| payments::BankTransferData::Pse {} => Err(errors::ConnectorError::NotSupported {
|
||||
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
|
||||
connector: "Shift4",
|
||||
}
|
||||
| payments::BankTransferData::Pse {} => Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into()),
|
||||
}
|
||||
}
|
||||
@ -257,11 +244,8 @@ impl TryFrom<&api_models::payments::VoucherData> for Shift4PaymentMethod {
|
||||
type Error = Error;
|
||||
fn try_from(voucher_data: &api_models::payments::VoucherData) -> Result<Self, Self::Error> {
|
||||
match voucher_data {
|
||||
payments::VoucherData::Boleto(_) => Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into()),
|
||||
payments::VoucherData::Efecty
|
||||
payments::VoucherData::Boleto(_)
|
||||
| payments::VoucherData::Efecty
|
||||
| payments::VoucherData::PagoEfectivo
|
||||
| payments::VoucherData::RedCompra
|
||||
| payments::VoucherData::RedPagos
|
||||
@ -273,10 +257,9 @@ impl TryFrom<&api_models::payments::VoucherData> for Shift4PaymentMethod {
|
||||
| payments::VoucherData::MiniStop(_)
|
||||
| payments::VoucherData::FamilyMart(_)
|
||||
| payments::VoucherData::Seicomart(_)
|
||||
| payments::VoucherData::PayEasy(_) => Err(errors::ConnectorError::NotSupported {
|
||||
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
|
||||
connector: "Shift4",
|
||||
}
|
||||
| payments::VoucherData::PayEasy(_) => Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into()),
|
||||
}
|
||||
}
|
||||
@ -286,15 +269,12 @@ impl TryFrom<&api_models::payments::GiftCardData> for Shift4PaymentMethod {
|
||||
type Error = Error;
|
||||
fn try_from(gift_card_data: &api_models::payments::GiftCardData) -> Result<Self, Self::Error> {
|
||||
match gift_card_data {
|
||||
payments::GiftCardData::Givex(_) => Err(errors::ConnectorError::NotSupported {
|
||||
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
|
||||
connector: "Shift4",
|
||||
payments::GiftCardData::Givex(_) | payments::GiftCardData::PaySafeCard {} => {
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
.into()),
|
||||
payments::GiftCardData::PaySafeCard {} => Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -401,10 +381,9 @@ impl<T> TryFrom<&types::RouterData<T, types::CompleteAuthorizeData, types::Payme
|
||||
| Some(payments::PaymentMethodData::Reward)
|
||||
| Some(payments::PaymentMethodData::Upi(_))
|
||||
| Some(api::PaymentMethodData::CardToken(_))
|
||||
| None => Err(errors::ConnectorError::NotSupported {
|
||||
message: "Flow".to_string(),
|
||||
connector: "Shift4",
|
||||
}
|
||||
| None => Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into()),
|
||||
}
|
||||
}
|
||||
@ -421,13 +400,8 @@ impl TryFrom<&payments::BankRedirectData> for PaymentMethodType {
|
||||
payments::BankRedirectData::BancontactCard { .. }
|
||||
| payments::BankRedirectData::Blik { .. }
|
||||
| payments::BankRedirectData::Trustly { .. }
|
||||
| payments::BankRedirectData::Przelewy24 { .. } => {
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
payments::BankRedirectData::Bizum {}
|
||||
| payments::BankRedirectData::Przelewy24 { .. }
|
||||
| payments::BankRedirectData::Bizum {}
|
||||
| payments::BankRedirectData::Interac { .. }
|
||||
| payments::BankRedirectData::OnlineBankingCzechRepublic { .. }
|
||||
| payments::BankRedirectData::OnlineBankingFinland { .. }
|
||||
@ -436,10 +410,9 @@ impl TryFrom<&payments::BankRedirectData> for PaymentMethodType {
|
||||
| payments::BankRedirectData::OpenBankingUk { .. }
|
||||
| payments::BankRedirectData::OnlineBankingFpx { .. }
|
||||
| payments::BankRedirectData::OnlineBankingThailand { .. } => {
|
||||
Err(errors::ConnectorError::NotSupported {
|
||||
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
|
||||
connector: "Shift4",
|
||||
}
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Shift4"),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user