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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(core): update additional payment method data in psync response (#9519)
Vani Gupta407be56ed368
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rsindex 7b996e586b..914daaff9d 100644--- a/crates/router/src/core/payments/operations/payment_response.rs+++ b/crates/router/src/core/payments/operations/payment_response.rs@@ -1409,45 +1409,29 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(// This is for details like whether 3ds was upgraded and which version of 3ds was used// also some connectors might send card network details in the response, which is captured and stored+ let additional_payment_data = payment_data.payment_attempt.get_payment_method_data();+let additional_payment_method_data = match payment_data.payment_method_data.clone() {- Some(payment_method_data) => match payment_method_data {- hyperswitch_domain_models::payment_method_data::PaymentMethodData::Card(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardRedirect(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::Wallet(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::PayLater(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankRedirect(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankDebit(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankTransfer(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::Crypto(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::MandatePayment- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::Reward- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::RealTimePayment(- _,- )- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::MobilePayment(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::Upi(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::Voucher(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::GiftCard(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardToken(_)- | hyperswitch_domain_models::payment_method_data::PaymentMethodData::OpenBanking(_) => {- update_additional_payment_data_with_connector_response_pm_data(- payment_data.payment_attempt.payment_method_data.clone(),- router_data- .connector_response- .as_ref()- .and_then(|connector_response| {- connector_response.additional_payment_method_data.clone()- }),- )?- }- hyperswitch_domain_models::payment_method_data::PaymentMethodData::NetworkToken(_) => {- payment_data.payment_attempt.payment_method_data.clone()- }- hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {- payment_data.payment_attempt.payment_method_data.clone()- }- },- None => None,+ Some(hyperswitch_domain_models::payment_method_data::PaymentMethodData::NetworkToken(_))+ | Some(hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardDetailsForNetworkTransactionId(_)) => {+ payment_data.payment_attempt.payment_method_data.clone()+ }+ _ => {+ additional_payment_data+ .map(|_| {+ update_additional_payment_data_with_connector_response_pm_data(+ payment_data.payment_attempt.payment_method_data.clone(),+ router_data+ .connector_response+ .as_ref()+ .and_then(|connector_response| {+ connector_response.additional_payment_method_data.clone()+ }),+ )+ })+ .transpose()?+ .flatten()+ }};router_data.payment_method_status.and_then(|status| {