collect_metrics_data (collectors/metrics.py)

polar · server/polar/organization_review/collectors/metrics.py · python · Apache-2.0
analytics

Module exposing: collect_metrics_data

# Source: https://github.com/polarsource/polar | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from ..schemas import PaymentMetrics


def collect_metrics_data(
    *,
    total_payments: int,
    succeeded_payments: int,
    total_amount_cents: int,
    p50_risk_score: int | None,
    p90_risk_score: int | None,
    refund_count: int,
    refund_amount_cents: int,
    dispute_count: int,
    dispute_amount_cents: int,
    chargeback_stop_count: int = 0,
    chargeback_stop_amount_cents: int = 0,
) -> PaymentMetrics:
    return PaymentMetrics(
        total_payments=total_payments,
        succeeded_payments=succeeded_payments,
        total_amount_cents=total_amount_cents,
        

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key