mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-11 18:59:20 +08:00
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:
@@ -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| {
|
||||
|
||||
@@ -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),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user