Skip to content

Commit

Permalink
refactor(connector): [Forte] change error message from not supported …
Browse files Browse the repository at this point in the history
…to not implemented (#2847)
  • Loading branch information
oscar2d2 authored Dec 17, 2023
1 parent 41b5a82 commit 3fc0e2d
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions crates/router/src/connector/forte/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ impl TryFrom<utils::CardIssuer> for ForteCardType {
utils::CardIssuer::Visa => Ok(Self::Visa),
utils::CardIssuer::DinersClub => Ok(Self::DinersClub),
utils::CardIssuer::JCB => Ok(Self::Jcb),
_ => Err(errors::ConnectorError::NotSupported {
message: issuer.to_string(),
connector: "Forte",
}
_ => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Forte"),
)
.into()),
}
}
Expand All @@ -67,10 +66,9 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for FortePaymentsRequest {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> {
if item.request.currency != enums::Currency::USD {
Err(errors::ConnectorError::NotSupported {
message: item.request.currency.to_string(),
connector: "Forte",
})?
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Forte"),
))?
}
match item.request.payment_method_data {
api_models::payments::PaymentMethodData::Card(ref ccard) => {
Expand Down Expand Up @@ -117,10 +115,9 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for FortePaymentsRequest {
| api_models::payments::PaymentMethodData::Voucher(_)
| api_models::payments::PaymentMethodData::GiftCard(_)
| api_models::payments::PaymentMethodData::CardToken(_) => {
Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Forte",
})?
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Forte"),
))?
}
}
}
Expand Down

0 comments on commit 3fc0e2d

Please sign in to comment.