Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(connector): [Shift4] change error message from NotSupported to NotImplemented #2880

Merged
merged 9 commits into from
Nov 30, 2023
49 changes: 21 additions & 28 deletions crates/router/src/connector/shift4/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Expand Down Expand Up @@ -212,10 +211,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(
unpervertedkid marked this conversation as resolved.
Show resolved Hide resolved
utils::get_unimplemented_payment_method_error_message("Shift4"),
)
.into()),
}
}
Expand Down Expand Up @@ -244,10 +242,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(
unpervertedkid marked this conversation as resolved.
Show resolved Hide resolved
utils::get_unimplemented_payment_method_error_message("Shift4"),
)
.into()),
}
}
Expand All @@ -273,10 +270,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(
unpervertedkid marked this conversation as resolved.
Show resolved Hide resolved
utils::get_unimplemented_payment_method_error_message("Shift4"),
)
.into()),
}
}
Expand All @@ -286,10 +282,9 @@ 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(_) => Err(errors::ConnectorError::NotImplemented(
unpervertedkid marked this conversation as resolved.
Show resolved Hide resolved
utils::get_unimplemented_payment_method_error_message("Shift4"),
)
.into()),
payments::GiftCardData::PaySafeCard {} => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Shift4"),
Expand Down Expand Up @@ -401,10 +396,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()),
}
}
Expand Down Expand Up @@ -436,10 +430,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())
}
}
Expand Down
Loading