Analytics Architecture

Describe how PayPress Analytics retrieves and presents Stripe account metrics.

Purpose

Describe how PayPress Analytics retrieves and presents Stripe account metrics.

Overview

Analytics is labeled as Stripe Account Analytics. It pulls account-wide data from Stripe APIs and caches results with short-lived transients.

How It Works

PayPress uses Stripe list APIs and balance transaction data to calculate revenue, refunds, revenue after refunds, Stripe Net Volume, successful payments, failed attempts, and subscription health for selected time ranges.

Important Components

  • Analytics service.
  • Stripe charges.
  • Stripe balance transactions.
  • Stripe subscriptions.
  • Time-range selection.
  • Currency grouping.
  • Transient cache.
  • Refresh from Stripe action.
  • Stale-data fallback.

Data Flow

Analytics page load -> read cache -> if missing, fetch from Stripe -> group by currency -> render metrics -> refresh clears selected cache and fetches fresh data.

Security Considerations

Analytics requires admin access and valid Stripe API keys. It does not expose secret keys or raw payment method data.

Known Limitations

Analytics is not installation-scoped. Multiple PayPress sites sharing one Stripe account will see account-wide Stripe metrics. It does not create local analytics tables or cron aggregation.

Related Articles