Skip to main content

benecaster_subscription_payment_failed

Action Premium

Fires exactly once per payment failure cycle when a subscriber’s payment first fails. Fires for the built-in membership system and for all external bridge adapters — MemberPress, WooCommerce Subscriptions, Restrict Content Pro, and Paid Memberships Pro — so a single callback covers payment failures regardless of which membership plugin the podcaster uses. The $tier_slug parameter is populated for all bridge types.

Subsequent retry attempts in the same failure cycle do not re-fire this hook. When the subscription is ultimately cancelled after all retries are exhausted, benecaster_subscription_cancelled fires; this hook does not fire again at that point.

Parameters

Name Type Default Description
$user_id int WordPress user ID
$show_id int ID of the show
$tier_slug string Tier slug

Examples

Flag subscriber in CRM and start win-back sequence

add_action( 'benecaster_subscription_payment_failed', function ( int $user_id, int $show_id, string $tier_slug ): void {
    $user = get_userdata( $user_id );
    if ( ! $user ) {
        return;
    }
    my_crm_add_tag( $user->user_email, 'payment-failed' );
    my_crm_start_winback_sequence( $user->user_email, $tier_slug );
}, 10, 3 );

Notes

Never revoke the subscriber's feed token in a callback on this hook. Stripe's retry window typically spans three weeks across four attempts, and feed access continues throughout this window — the past_due status is treated as active. Only benecaster_subscription_cancelled — fired after all retries are exhausted — should trigger access revocation.

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