Event Traces
Understanding event traces and how they track system activities
Overview
Event traces provide a detailed audit trail of actions taken within the PayNowPro system. When a manual action is performed, traces capture every automatic action the system executes to complete that operation in its entirety.
What are Event Traces?
An event trace is a chronological record that documents the cascade of events triggered by a single action. Each trace consists of:
- Trace ID: A unique identifier linking related events together
- Event ID: A unique identifier for each individual event within the trace
- Timestamp: When the event occurred
- Executor ID: Who or what triggered the event (user ID or "system")
- Activity Type: The type of event that occurred
- Payload: Event-specific data relevant to the action
- Parent ID: Links child events to their parent event (optional)
Event Types
The system tracks the following event types:
Payment Events
- PaymentEvent: Tracks payment processing with payment intent, product, price, and customer details
Subscription Events
- SubscriptionCreationEvent: Records new subscription creation
- SubscriptionCancellationEvent: Tracks subscription cancellations
- SubscriptionDeletionEvent: Records subscription deletions
- SubscriptionScheduledChangeEvent: Tracks scheduled upgrades or downgrades
Recurring Payment Events
- RecurringPaymentCancellationEvent: Records cancellation of recurring payments
Product & Price Events
- ProductDeletionEvent: Tracks product deletions
- ProductExpiryEvent: Records product expiration
- PriceDeletionEvent: Tracks price deletions
- PriceUpdateEvent: Records price updates
Customer Events
- CustomerDeletionEvent: Tracks customer deletions
Trace Structure
Each event trace contains:
- tenantAlias: The tenant identifier
- traceId: Links all related events
- eventId: Unique identifier for this specific event
- executorId: User ID or "system"
- parentId: Links to parent event (if applicable)
- isRoot: Boolean indicating if this is the root event
- activityType: The type of event
- payload: Event-specific data
- createdAt: ISO timestamp
Data Enrichment
The system automatically enriches trace data by fetching related entities when needed. If customer, product, or price information is missing from the payload, the tracer will retrieve it from the database based on the event type's requirements.
Use Cases
- Audit Trails: Track who did what and when
- Debugging: Trace the complete flow of a failed operation
- Analytics: Analyze user behavior and system patterns
- Compliance: Maintain records of all system activities
- Troubleshooting: Identify where in a multi-step process an issue occurred