Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(connector): [STAX] Add currency filter for payments through Stax (#1911)

DEEPANSHU BANSAL5bc7592af3c8
diff --git a/crates/router/src/connector/stax/transformers.rs b/crates/router/src/connector/stax/transformers.rs
index 7cb3e8dda2..c4b8dd326a 100644
--- a/crates/router/src/connector/stax/transformers.rs
+++ b/crates/router/src/connector/stax/transformers.rs
@@ -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()?;