feat(events): Add payment metadata to hyperswitch-payment-intent-events (#5170)

Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com>
Co-authored-by: Sampras Lopes <Sampras.lopes@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sandeep Kumar
2024-07-05 20:15:25 +05:30
committed by GitHub
parent 16e8f4b263
commit 5ebfbaf199
25 changed files with 146 additions and 119 deletions

View File

@@ -320,7 +320,7 @@ where
.or_else(||
// when the order_details are present within the meta_data, we need to take those to support backward compatibility
payment_data.payment_intent.metadata.clone().and_then(|meta| {
let order_details = meta.peek().get("order_details").to_owned();
let order_details = meta.get("order_details").to_owned();
order_details.map(|order| vec![masking::Secret::new(order.to_owned())])
}))
.map(|order_details_value| {

View File

@@ -1690,7 +1690,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SetupMandateRequ
Some(RequestIncrementalAuthorization::True)
| Some(RequestIncrementalAuthorization::Default)
),
metadata: payment_data.payment_intent.metadata.clone(),
metadata: payment_data.payment_intent.metadata.clone().map(Into::into),
})
}
}