feat(connector): [Authorizedotnet] add network transaction id support#13156
feat(connector): [Authorizedotnet] add network transaction id support#13156likhinbopanna wants to merge 3 commits into
Conversation
- Add authorizedotnet to network_transaction_id_supported_connectors across all config deployments - Handle CardDetailsForNetworkTransactionId and MandatePayment in AuthorizeDotNet transformer payment request - Fix debug-build stack overflow by setting RUST_MIN_STACK at runtime before Tokio runtime creation - Update cypress test configs for authorizedotnet NTID flow
Changed Files
|
|
PLACEHOLDER_COMMENT_FOR_RETRIEVAL |
Code Review FindingsOverall AssessmentThis PR adds Network Transaction ID support for Authorizedotnet and includes a debug build stack overflow fix. The changes are generally well-structured, but there are a few items to address: Findings1. [should-fix] Missing SAFETY comment for runtime environment variable manipulation In
// SAFETY: Setting RUST_MIN_STACK before any thread creation is safe as std::thread
// reads this env var only at spawn time. We set this before building the Tokio runtime.
#[cfg(debug_assertions)]
if std::env::var_os("RUST_MIN_STACK").is_none() {
std::env::set_var("RUST_MIN_STACK", "67108864"); // 64 MiB
}2. [nit] In 3. [nit] Import reordering in Utils.js The alphabetization of imports ( Approved with minor suggestionsThe functional changes look correct. The NTID support implementation follows the existing patterns, and the stack overflow fix addresses a real debug-build issue. Please consider adding the SAFETY comment before merge. |
|
In the
The current silent PaymentMethodData::MandatePayment => {
// Explicitly not supported for this Authorizedotnet flow
return Err(IntegrationError::NotImplemented(
"MandatePayment not supported for Authorizedotnet".to_string(),
Default::default(),
))?;
} |
|
The Consider adding a maximum bound check: if let Some(val) = std::env::var_os("RUST_MIN_STACK") {
if let Ok(bytes) = val.to_string_lossy().parse::<usize>() {
if bytes > 512 * 1024 * 1024 { // 512 MiB max
eprintln!("Warning: RUST_MIN_STACK exceeds maximum allowed, using default");
std::env::set_var("RUST_MIN_STACK", "67108864");
}
}
} |
9f74c7e to
ff1b36f
Compare
Automated Code Review ResultsTeam: Connector Findings Summary✅ Well-Rounded Feature Implementation Detailed Review1. Connector Configuration (6 config files) 2. Transformer Changes ( 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,
}))
}
3. Stack Overflow Fix (
🔍 Suggestion: #[cfg(debug_assertions)] {
let stack_size = std::env::var("RUST_MIN_STACK").unwrap_or_default();
logger::debug!("Worker thread stack size: {}", stack_size);
}4. Test Updates Overall Assessment: Clean implementation with a valuable infrastructure fix. Approved. |
|
In PaymentMethodData::MandatePayment => None,Returning Questions:
Fix: Add a comment explaining when PaymentMethodData::MandatePayment => {
// MandatePayment data comes from a stored mandate;
// NTID flows don't need card details in the payment field
None
} |
|
💡 Runtime stack size modification approach In std::env::set_var("RUST_MIN_STACK", "67108864"); // 64 MiBSetting stack size at runtime has limitations:
Fix: Move this configuration to:
# .cargo/config.toml
[env]
RUST_MIN_STACK = "67108864" |
|
💡 Stack size increase lacks consistency with build.rs The runtime stack size (64 MiB) is 6× larger than the previous build.rs setting (11 MiB). Additionally, |
|
The mapping explicitly sets Some(PaymentDetails::CreditCard(CreditCardDetails {
card_number: ...,
expiration_date: ...,
card_code: None, // CVC explicitly suppressed
}))For NTID flows, some issuers require CVV on the first transaction. Please verify this suppression is intentional and document if NTID transactions may fail without CVV. |
|
The PaymentMethodData::MandatePayment => None,This sends empty payment data to Authorize.Net for MIT transactions. The processor will likely reject this with a generic "missing payment data" error. Either extract the mandate reference for |
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --allcargo clippy