mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat: add relevant ids for payment calls & make json logs (#908)
This commit is contained in:
@ -9,7 +9,7 @@ use std::{fmt::Debug, marker::PhantomData, time::Instant};
|
||||
use api_models::payments::Metadata;
|
||||
use error_stack::{IntoReport, ResultExt};
|
||||
use futures::future::join_all;
|
||||
use router_env::tracing;
|
||||
use router_env::{instrument, tracing};
|
||||
use time;
|
||||
|
||||
pub use self::operations::{
|
||||
@ -38,6 +38,7 @@ use crate::{
|
||||
utils::{Encode, OptionExt, ValueExt},
|
||||
};
|
||||
|
||||
#[instrument(skip_all, fields(payment_id, merchant_id))]
|
||||
pub async fn payments_operation_core<F, Req, Op, FData>(
|
||||
state: &AppState,
|
||||
merchant_account: storage::MerchantAccount,
|
||||
@ -63,11 +64,13 @@ where
|
||||
{
|
||||
let operation: BoxedOperation<'_, F, Req> = Box::new(operation);
|
||||
|
||||
tracing::Span::current().record("merchant_id", merchant_account.merchant_id.as_str());
|
||||
|
||||
let (operation, validate_result) = operation
|
||||
.to_validate_request()?
|
||||
.validate_request(&req, &merchant_account)?;
|
||||
|
||||
tracing::Span::current().record("payment_id", &format!("{:?}", validate_result.payment_id));
|
||||
tracing::Span::current().record("payment_id", &format!("{}", validate_result.payment_id));
|
||||
|
||||
let (operation, mut payment_data, customer_details) = operation
|
||||
.to_get_tracker()?
|
||||
|
||||
Reference in New Issue
Block a user