feat(core): update additional payment method data in psync response (#9519)

Co-authored-by: Vani Gupta <vani.gupta@juspay.in>
This commit is contained in:
Vani Gupta
2025-09-26 13:15:18 +05:30
committed by GitHub
parent 96e44a75dc
commit 407be56ed3

View File

@ -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 // 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 // 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() { let additional_payment_method_data = match payment_data.payment_method_data.clone() {
Some(payment_method_data) => match payment_method_data { Some(hyperswitch_domain_models::payment_method_data::PaymentMethodData::NetworkToken(_))
hyperswitch_domain_models::payment_method_data::PaymentMethodData::Card(_) | Some(hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardDetailsForNetworkTransactionId(_)) => {
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardRedirect(_) payment_data.payment_attempt.payment_method_data.clone()
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::Wallet(_) }
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::PayLater(_) _ => {
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankRedirect(_) additional_payment_data
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankDebit(_) .map(|_| {
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankTransfer(_) update_additional_payment_data_with_connector_response_pm_data(
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::Crypto(_) payment_data.payment_attempt.payment_method_data.clone(),
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::MandatePayment router_data
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::Reward .connector_response
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::RealTimePayment( .as_ref()
_, .and_then(|connector_response| {
) connector_response.additional_payment_method_data.clone()
| 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(_) .transpose()?
| hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardToken(_) .flatten()
| 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,
}; };
router_data.payment_method_status.and_then(|status| { router_data.payment_method_status.and_then(|status| {