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
chore(events): making events nanosecond level precision (#8759)
Shivansh Mathurc6fcf29f692b
diff --git a/crates/router/src/services/kafka/dispute_event.rs b/crates/router/src/services/kafka/dispute_event.rsindex 13301c3028..d8d06ce9a5 100644--- a/crates/router/src/services/kafka/dispute_event.rs+++ b/crates/router/src/services/kafka/dispute_event.rs@@ -29,9 +29,9 @@ pub struct KafkaDisputeEvent<'a> {pub connector_created_at: Option<OffsetDateTime>,#[serde(default, with = "time::serde::timestamp::nanoseconds::option")]pub connector_updated_at: Option<OffsetDateTime>,- #[serde(default, with = "time::serde::timestamp::nanoseconds")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub created_at: OffsetDateTime,- #[serde(default, with = "time::serde::timestamp::nanoseconds")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub modified_at: OffsetDateTime,pub connector: &'a String,pub evidence: &'a Secret<serde_json::Value>,diff --git a/crates/router/src/services/kafka/fraud_check_event.rs b/crates/router/src/services/kafka/fraud_check_event.rsindex 4fd7117441..1948f27816 100644--- a/crates/router/src/services/kafka/fraud_check_event.rs+++ b/crates/router/src/services/kafka/fraud_check_event.rs@@ -11,7 +11,7 @@ pub struct KafkaFraudCheckEvent<'a> {pub payment_id: &'a common_utils::id_type::PaymentId,pub merchant_id: &'a common_utils::id_type::MerchantId,pub attempt_id: &'a String,- #[serde(default, with = "time::serde::timestamp::milliseconds")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub created_at: OffsetDateTime,pub frm_name: &'a String,pub frm_transaction_id: Option<&'a String>,@@ -22,7 +22,7 @@ pub struct KafkaFraudCheckEvent<'a> {pub frm_error: Option<&'a String>,pub payment_details: Option<serde_json::Value>,pub metadata: Option<serde_json::Value>,- #[serde(default, with = "time::serde::timestamp::milliseconds")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub modified_at: OffsetDateTime,pub last_step: FraudCheckLastStep,pub payment_capture_method: Option<storage_enums::CaptureMethod>, // In postFrm, we are updating capture method from automatic to manual. To store the merchant actual capture method, we are storing the actual capture method in payment_capture_method. It will be useful while approving the FRM decision.diff --git a/crates/router/src/services/kafka/payment_attempt_event.rs b/crates/router/src/services/kafka/payment_attempt_event.rsindex 4bff1b7646..eea3916f80 100644--- a/crates/router/src/services/kafka/payment_attempt_event.rs+++ b/crates/router/src/services/kafka/payment_attempt_event.rs@@ -156,11 +156,11 @@ pub struct KafkaPaymentAttemptEvent<'a> {pub payment_method: storage_enums::PaymentMethod,pub connector_transaction_id: Option<&'a String>,pub authentication_type: storage_enums::AuthenticationType,- #[serde(with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub created_at: OffsetDateTime,- #[serde(with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub modified_at: OffsetDateTime,- #[serde(default, with = "time::serde::timestamp::option")]+ #[serde(default, with = "time::serde::timestamp::nanoseconds::option")]pub last_synced: Option<OffsetDateTime>,pub cancellation_reason: Option<&'a String>,pub amount_to_capture: Option<MinorUnit>,diff --git a/crates/router/src/services/kafka/payment_intent_event.rs b/crates/router/src/services/kafka/payment_intent_event.rsindex 3e0733eeb7..db6de3cce1 100644--- a/crates/router/src/services/kafka/payment_intent_event.rs+++ b/crates/router/src/services/kafka/payment_intent_event.rs@@ -74,11 +74,11 @@ pub struct KafkaPaymentIntentEvent<'a> {pub return_url: Option<&'a common_types::Url>,pub metadata: Option<&'a Secret<Value>>,pub statement_descriptor: Option<&'a common_types::StatementDescriptor>,- #[serde(with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub created_at: OffsetDateTime,- #[serde(with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub modified_at: OffsetDateTime,- #[serde(default, with = "time::serde::timestamp::option")]+ #[serde(default, with = "time::serde::timestamp::nanoseconds::option")]pub last_synced: Option<OffsetDateTime>,pub setup_future_usage: storage_enums::FutureUsage,pub off_session: bool,@@ -97,7 +97,7 @@ pub struct KafkaPaymentIntentEvent<'a> {pub surcharge_applicable: Option<bool>,pub request_incremental_authorization: RequestIncrementalAuthorization,pub authorization_count: Option<i32>,- #[serde(with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub session_expiry: OffsetDateTime,pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,pub frm_metadata: Option<Secret<&'a Value>>,diff --git a/crates/router/src/services/kafka/refund_event.rs b/crates/router/src/services/kafka/refund_event.rsindex 18cc0445cc..fed6ee52af 100644--- a/crates/router/src/services/kafka/refund_event.rs+++ b/crates/router/src/services/kafka/refund_event.rs@@ -31,9 +31,9 @@ pub struct KafkaRefundEvent<'a> {pub sent_to_gateway: &'a bool,pub refund_error_message: Option<&'a String>,pub refund_arn: Option<&'a String>,- #[serde(default, with = "time::serde::timestamp::nanoseconds")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub created_at: OffsetDateTime,- #[serde(default, with = "time::serde::timestamp::nanoseconds")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub modified_at: OffsetDateTime,pub description: Option<&'a String>,pub attempt_id: &'a String,@@ -95,9 +95,9 @@ pub struct KafkaRefundEvent<'a> {pub sent_to_gateway: &'a bool,pub refund_error_message: Option<&'a String>,pub refund_arn: Option<&'a String>,- #[serde(default, with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub created_at: OffsetDateTime,- #[serde(default, with = "time::serde::timestamp")]+ #[serde(with = "time::serde::timestamp::nanoseconds")]pub modified_at: OffsetDateTime,pub description: Option<&'a String>,pub attempt_id: &'a id_type::GlobalAttemptId,