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(mandate): allow card details to be provided in case of network transaction id (#1138)

Nishant Joshicc121d0febcb
diff --git a/crates/router/src/connector/authorizedotnet/transformers.rs b/crates/router/src/connector/authorizedotnet/transformers.rs
index 1c3ec89156..75f5dfc192 100644
--- a/crates/router/src/connector/authorizedotnet/transformers.rs
+++ b/crates/router/src/connector/authorizedotnet/transformers.rs
@@ -120,7 +120,9 @@ fn get_pm_and_subsequent_auth_detail(
expiration_date: ccard.get_expiry_date_as_yyyymm("-"),
card_code: Some(ccard.card_cvc.clone()),
}),
- None,
+ Some(ProcessingOptions {
+ is_subsequent_auth: true,
+ }),
None,
))
}
@@ -151,6 +153,7 @@ struct TransactionRequest {
currency_code: String,
payment: PaymentDetails,
processing_options: Option<ProcessingOptions>,
+ #[serde(skip_serializing_if = "Option::is_none")]
subsequent_auth_information: Option<SubsequentAuthInformation>,
authorization_indicator_type: Option<AuthorizationIndicator>,
}
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index ee34498981..1be4c8fb66 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -765,10 +765,18 @@ where
{
let connector = payment_data.payment_attempt.connector.to_owned();
+ let is_mandate = payment_data
+ .mandate_id
+ .as_ref()
+ .and_then(|inner| inner.mandate_reference_id.as_ref())
+ .map(|mandate_reference| match mandate_reference {
+ api_models::payments::MandateReferenceId::ConnectorMandateId(_) => true,
+ api_models::payments::MandateReferenceId::NetworkMandateId(_) => false,
+ })
+ .unwrap_or(false);
+
let payment_data_and_tokenization_action = match connector {
- Some(_) if payment_data.mandate_id.is_some() => {
- (payment_data, TokenizationAction::SkipConnectorTokenization)
- }
+ Some(_) if is_mandate => (payment_data, TokenizationAction::SkipConnectorTokenization),
Some(connector) if is_operation_confirm(&operation) => {
let payment_method = &payment_data
.payment_attempt