diff --git a/config/config.example.toml b/config/config.example.toml index 33f63e458b6..2002d308877 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -1308,7 +1308,7 @@ fetch_altid_url= "" # base url to fetch Alt-ID and cryptogram for gues connector_list = "adyen,cybersource,peachpayments,trustpay" # Supported connectors for network tokenization [network_transaction_id_supported_connectors] -connector_list = "adyen,archipel,checkout,cybersource,novalnet,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" # Supported connectors for network transaction id +connector_list = "adyen,archipel,authorizedotnet,checkout,cybersource,novalnet,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" # Supported connectors for network transaction id [card_only_mit_supported_connectors] connector_list = "peachpayments" # Supported connectors for card only mit diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index 5aecded3f77..ce591bde146 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -298,7 +298,7 @@ card.debit = "adyen" adyen = "BRL,MXN,JPY" [network_transaction_id_supported_connectors] -connector_list = "adyen,archipel,checkout,cybersource,novalnet,nuvei,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" +connector_list = "adyen,archipel,authorizedotnet,checkout,cybersource,novalnet,nuvei,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" [card_only_mit_supported_connectors] connector_list = "peachpayments" # Supported connectors for card only mit diff --git a/config/deployments/production.toml b/config/deployments/production.toml index 1e4ec8875f4..0be1e671e86 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -298,7 +298,7 @@ card.debit = "adyen" adyen = "BRL,MXN,JPY" [network_transaction_id_supported_connectors] -connector_list = "adyen,archipel,checkout,cybersource,stripe,nuvei,worldpayvantiv,revolv3,peachpayments" +connector_list = "adyen,archipel,authorizedotnet,checkout,cybersource,stripe,nuvei,worldpayvantiv,revolv3,peachpayments" [card_only_mit_supported_connectors] connector_list = "peachpayments" # Supported connectors for card only mit diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index 7725e938675..2dfcc4eebfc 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -305,7 +305,7 @@ card.debit = "adyen" adyen = "BRL,MXN,JPY" [network_transaction_id_supported_connectors] -connector_list = "adyen,archipel,checkout,cybersource,novalnet,nuvei,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" +connector_list = "adyen,archipel,authorizedotnet,checkout,cybersource,novalnet,nuvei,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" [card_only_mit_supported_connectors] connector_list = "peachpayments" # Supported connectors for card only mit diff --git a/config/development.toml b/config/development.toml index fdaf8711129..96f8d62ddfd 100644 --- a/config/development.toml +++ b/config/development.toml @@ -1238,7 +1238,7 @@ card.debit = "adyen" adyen = "BRL,MXN,JPY" [network_transaction_id_supported_connectors] -connector_list = "adyen,archipel,checkout,cybersource,novalnet,nuvei,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" +connector_list = "adyen,archipel,authorizedotnet,checkout,cybersource,novalnet,nuvei,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" [card_only_mit_supported_connectors] connector_list = "peachpayments" # Supported connectors for card only mit diff --git a/config/docker_compose.toml b/config/docker_compose.toml index 0184a3ef28d..5ec48bcf355 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -1134,7 +1134,7 @@ card.debit = "adyen" adyen = "BRL,MXN,JPY" [network_transaction_id_supported_connectors] -connector_list = "adyen,archipel,checkout,cybersource,novalnet,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" +connector_list = "adyen,archipel,authorizedotnet,checkout,cybersource,novalnet,stripe,worldpay,worldpayvantiv,revolv3,peachpayments" [card_only_mit_supported_connectors] connector_list = "peachpayments" # Supported connectors for card only mit diff --git a/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs index c3b2d2e9fac..e152f8a7a1b 100644 --- a/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs @@ -923,14 +923,22 @@ impl transaction_type: TransactionType::try_from(item.router_data.request.capture_method)?, amount: item.amount, currency_code: item.router_data.request.currency, - payment: Some(match item.router_data.request.payment_method_data { + payment: match item.router_data.request.payment_method_data { PaymentMethodData::Card(ref ccard) => { - PaymentDetails::CreditCard(CreditCardDetails { + Some(PaymentDetails::CreditCard(CreditCardDetails { card_number: (*ccard.card_number).clone(), expiration_date: ccard.get_expiry_date_as_yyyymm("-"), card_code: None, - }) + })) + } + PaymentMethodData::CardDetailsForNetworkTransactionId(ref card_details) => { + Some(PaymentDetails::CreditCard(CreditCardDetails { + card_number: (*card_details.card_number).clone(), + expiration_date: card_details.get_expiry_date_as_yyyymm("-"), + card_code: None, + })) } + PaymentMethodData::MandatePayment => None, PaymentMethodData::CardRedirect(_) | PaymentMethodData::Wallet(_) | PaymentMethodData::PayLater(_) @@ -938,7 +946,6 @@ impl | PaymentMethodData::BankDebit(_) | PaymentMethodData::BankTransfer(_) | PaymentMethodData::Crypto(_) - | PaymentMethodData::MandatePayment | PaymentMethodData::Reward | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::MobilePayment(_) @@ -948,7 +955,6 @@ impl | PaymentMethodData::OpenBanking(_) | PaymentMethodData::CardToken(_) | PaymentMethodData::NetworkToken(_) - | PaymentMethodData::CardDetailsForNetworkTransactionId(_) | PaymentMethodData::CardWithOptionalCVC(_) | PaymentMethodData::CardWithNetworkTokenDetails(_) | PaymentMethodData::CardWithLimitedDetails(_) @@ -958,7 +964,7 @@ impl utils::get_unimplemented_payment_method_error_message("authorizedotnet"), ))? } - }), + }, profile: None, order: Order { invoice_number: match &item.router_data.request.merchant_order_reference_id { diff --git a/crates/router/build.rs b/crates/router/build.rs index 0d7fac83437..14fc11f535a 100644 --- a/crates/router/build.rs +++ b/crates/router/build.rs @@ -1,8 +1,10 @@ fn main() { - // Set thread stack size to 11 MiB for debug builds + // NOTE: the worker-thread stack size for debug builds is set at *runtime* + // in `src/bin/router.rs` (via `RUST_MIN_STACK`), not here. A + // `cargo:rustc-env` instruction only affects the compile-time environment + // (`env!`) and does not size threads spawned by `std`/Tokio/actix at + // runtime, so it cannot prevent stack overflows in deep async flows. // Reference: https://doc.rust-lang.org/std/thread/#stack-size - #[cfg(debug_assertions)] - println!("cargo:rustc-env=RUST_MIN_STACK=11534336"); // 11 * 1024 * 1024 = 11 MiB #[cfg(feature = "vergen")] router_env::vergen::generate_cargo_instructions(); diff --git a/crates/router/src/bin/router.rs b/crates/router/src/bin/router.rs index 62086b4abf1..be9b76c07c9 100644 --- a/crates/router/src/bin/router.rs +++ b/crates/router/src/bin/router.rs @@ -6,8 +6,31 @@ use router::{ routes::metrics, }; -#[tokio::main] -async fn main() -> ApplicationResult<()> { +fn main() -> ApplicationResult<()> { + // In debug builds the deeply-nested async payment flows (notably the + // auto-retry path, which re-enters the entire payment execution) can exceed + // the default worker-thread stack and abort the process with a stack + // overflow. Raise the stack size for every worker thread *before* the Tokio + // runtime is created, because `std` caches `RUST_MIN_STACK` on the first + // thread spawn — setting it after the runtime is built has no effect on the + // already-spawned Tokio/actix worker threads. + // + // Release builds are unaffected: this block is compiled out and, thanks to + // optimization, they never reach this stack depth. An explicit + // `RUST_MIN_STACK` from the environment is always respected. + #[cfg(debug_assertions)] + if std::env::var_os("RUST_MIN_STACK").is_none() { + std::env::set_var("RUST_MIN_STACK", "67108864"); // 64 MiB + } + + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .change_context(ApplicationError::ConfigurationError)? + .block_on(run()) +} + +async fn run() -> ApplicationResult<()> { // get commandline config before initializing config let cmd_line = ::parse(); diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js index 6b2cfdc956c..263ac4edf7c 100644 --- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js +++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js @@ -13,8 +13,8 @@ import { connectorDetails as bamboraConnectorDetails } from "./Bambora.js"; import { connectorDetails as bamboraapacConnectorDetails } from "./Bamboraapac.js"; import { connectorDetails as bankOfAmericaConnectorDetails } from "./BankOfAmerica.js"; import { connectorDetails as barclaycardConnectorDetails } from "./Barclaycard.js"; -import { connectorDetails as bitpayConnectorDetails } from "./Bitpay.js"; import { connectorDetails as billwerkConnectorDetails } from "./Billwerk.js"; +import { connectorDetails as bitpayConnectorDetails } from "./Bitpay.js"; import { connectorDetails as bluesnapConnectorDetails } from "./Bluesnap.js"; import { connectorDetails as braintreeConnectorDetails } from "./Braintree.js"; import { connectorDetails as calidaConnectorDetails } from "./Calida.js"; @@ -46,6 +46,7 @@ import { connectorDetails as itaubankConnectorDetails } from "./ItauBank.js"; import { connectorDetails as jpmorganConnectorDetails } from "./Jpmorgan.js"; import { connectorDetails as klarnaConnectorDetails } from "./Klarna.js"; import { connectorDetails as loonioConnectorDetails } from "./Loonio.js"; +import { connectorDetails as mifinityConnectorDetails } from "./Mifinity.js"; import { connectorDetails as mollieConnectorDetails } from "./Mollie.js"; import { connectorDetails as monerisConnectorDetails } from "./Moneris.js"; import { connectorDetails as multisafepayConnectorDetails } from "./Multisafepay.js"; @@ -82,7 +83,6 @@ import { connectorDetails as worldpayvantivConnectorDetails } from "./Worldpayva import { connectorDetails as worldpayxmlConnectorDetails } from "./Worldpayxml.js"; import { connectorDetails as xenditConnectorDetails } from "./Xendit.js"; import { connectorDetails as ziftConnectorDetails } from "./Zift.js"; -import { connectorDetails as mifinityConnectorDetails } from "./Mifinity.js"; const connectorDetails = { aci: aciConnectorDetails, adyen: adyenConnectorDetails, @@ -484,7 +484,6 @@ export const CONNECTOR_LISTS = { // Exclusion lists (skip these connectors) EXCLUDE: { CONNECTOR_AGNOSTIC_NTID: [ - "authorizedotnet", "bamboraapac", "bankofamerica", "billwerk",