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(payment): add connector_request_reference_id to PaymentAttemptUpdate in ConfirmIntentTokenized flow (#9597)

Ayush Anand55263047632d
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index f7e5ec78cb..7a2616bfcc 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -2046,6 +2046,7 @@ pub enum PaymentAttemptUpdate {
merchant_connector_id: id_type::MerchantConnectorAccountId,
authentication_type: storage_enums::AuthenticationType,
payment_method_id: id_type::GlobalPaymentMethodId,
+ connector_request_reference_id: Option<String>,
},
/// Update the payment attempt on confirming the intent, after calling the connector on success response
ConfirmIntentResponse(Box<ConfirmIntentResponseUpdate>),
@@ -3099,6 +3100,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
merchant_connector_id,
authentication_type,
payment_method_id,
+ connector_request_reference_id,
} => Self {
status: Some(status),
payment_method_id: Some(payment_method_id),
@@ -3124,7 +3126,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
- connector_request_reference_id: None,
+ connector_request_reference_id,
connector_response_reference_id: None,
cancellation_reason: None,
},
diff --git a/crates/router/src/core/payments/operations/payment_confirm_intent.rs b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
index 9720cee1d9..242ff3a425 100644
--- a/crates/router/src/core/payments/operations/payment_confirm_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
@@ -674,6 +674,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentConfirmData<F>, PaymentsConfirmInt
.attach_printable("Merchant connector id is none when constructing response")
})?,
authentication_type,
+ connector_request_reference_id,
payment_method_id : payment_method.get_id().clone()
}
}