Skip to content

Commit

Permalink
fix(connector): [STAX] Add currency filter for payments through Stax (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshu-iiitu authored Aug 10, 2023
1 parent 6bf4bda commit 5bc7592
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/router/src/connector/stax/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ pub struct StaxPaymentsRequest {
impl TryFrom<&types::PaymentsAuthorizeRouterData> for StaxPaymentsRequest {
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: "Stax",
payment_experience: api::enums::PaymentExperience::RedirectToUrl.to_string(),
})?
}
match item.request.payment_method_data.clone() {
api::PaymentMethodData::Card(_) => {
let pre_auth = !item.request.is_auto_capture()?;
Expand Down

0 comments on commit 5bc7592

Please sign in to comment.