Skip to main content

benecaster_donation_decline_alert_thresholds

Filter Free

Filters the thresholds at which Benecaster warns a podcaster in the notification bell that a show’s donation declines have spiked. Benecaster counts successes and failures over a rolling 24 hours per show and alerts at 10 or more attempts with 40% or more declining.

Both halves matter, and min_attempts is the one people delete. One genuinely expired card on a quiet day is a 100% decline rate. An alert that fires on that is an alert the podcaster learns to ignore, which costs more than it saves — Benecaster clamps the floor to a minimum of 1 for exactly that reason.

The counters are fed by the show’s Stripe payment_intent.payment_failed webhook event alone. A show subscribed only to payment_intent.succeeded produces no declines, no counters and no alert — silence there is absence of data, not health.

This does not detect card testing; it raises the cost and reports the shape. Stripe Radar’s card-testing rules recognise an attack, and they live on the podcaster’s own Stripe account. Any surface you build on this should say so rather than reading as the defence.

Parameters

Name Type Default Description
$thresholds array — Associative array with keys `min_attempts` (int, default 10) and `rate` (float 0-1, default 0.4).
$show_id int — ID of the show

Returns: array

Example

add_filter( 'benecaster_donation_decline_alert_thresholds', function( $thresholds, $show_id ) {
    // A high-traffic show can afford to alert sooner.
    return 42 === (int) $show_id
        ? [ 'min_attempts' => 25, 'rate' => 0.25 ]
        : $thresholds;
}, 10, 2 );

Need this built rather than just documented? See our services →