Skip to content

Commit

Permalink
refactor(connector): [Stax] change error message from NotSupported to…
Browse files Browse the repository at this point in the history
… NotImplemented (#2879)
  • Loading branch information
unpervertedkid authored Nov 29, 2023
1 parent c05432c commit 8a4dabc
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions crates/router/src/connector/stax/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ impl TryFrom<&StaxRouterData<&types::PaymentsAuthorizeRouterData>> for StaxPayme
item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>,
) -> Result<Self, Self::Error> {
if item.router_data.request.currency != enums::Currency::USD {
Err(errors::ConnectorError::NotSupported {
message: item.router_data.request.currency.to_string(),
connector: "Stax",
})?
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Stax"),
))?
}
let total = item.amount;

Expand Down Expand Up @@ -119,10 +118,9 @@ impl TryFrom<&StaxRouterData<&types::PaymentsAuthorizeRouterData>> for StaxPayme
| api::PaymentMethodData::GiftCard(_)
| api::PaymentMethodData::CardRedirect(_)
| api::PaymentMethodData::Upi(_)
| api::PaymentMethodData::CardToken(_) => Err(errors::ConnectorError::NotSupported {
message: "SELECTED_PAYMENT_METHOD".to_string(),
connector: "Stax",
})?,
| api::PaymentMethodData::CardToken(_) => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Stax"),
))?,
}
}
}
Expand Down Expand Up @@ -270,10 +268,9 @@ impl TryFrom<&types::TokenizationRouterData> for StaxTokenRequest {
| api::PaymentMethodData::GiftCard(_)
| api::PaymentMethodData::CardRedirect(_)
| api::PaymentMethodData::Upi(_)
| api::PaymentMethodData::CardToken(_) => Err(errors::ConnectorError::NotSupported {
message: "SELECTED_PAYMENT_METHOD".to_string(),
connector: "Stax",
})?,
| api::PaymentMethodData::CardToken(_) => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Stax"),
))?,
}
}
}
Expand Down

0 comments on commit 8a4dabc

Please sign in to comment.