decide_next_retry (revenue_recovery/schedule.rs)

hyperswitch · crates/router/src/core/revenue_recovery/schedule.rs · rust · Apache-2.0
payments

Determines next retry time for invoice recovery using static ladder rules.

// Source: https://github.com/juspay/hyperswitch | 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.
use time::PrimitiveDateTime;

/// How far along the static ladder an invoice has walked. A rung is one position in the
/// `pt_mapping_adaptive_retries` gap list; past the end the ladder is spent.
#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct StaticLadderProgress {
    /// Rungs already used; the next one to offer is `consumed_rungs + 1`.
    #[serde(default)]
    pub consumed_rungs: i32,
}

impl StaticLadderProgress {
    /// Opening position for an invoice entering recovery for the first time.
    pub fn seed_for_new_invoice(
       

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

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

Get a free API key