> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Failed and Skipped Payments

> Jane's installment fails because the card is declined.

## Real-World Example

Jane's installment fails because the card is declined. The portal records the failure, schedules follow-up where appropriate, retries after the configured wait, and may auto-skip the failed installment when the next due date is too close.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Scheduled payment fails"] --> B["Portal records failed transaction"]
    B --> C["Failure communication or follow-up is scheduled"]
    C --> D["Retry command runs at 21:00 after wait period"]
    D --> E{"Retry succeeds before next payment?"}
    E -->|Yes| F["Plan continues normally"]
    E -->|No| G["Auto-skip or hold handling runs"]
    classDef default fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef actor fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E;
    classDef system fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef decision fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F;
    classDef risk fill:#FEE2E2,stroke:#DC2626,stroke-width:2px,color:#7F1D1D;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;
    class A,B,C,D,F,G system;
    class E decision;
    class G risk;
    class F outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should record failed payment attempts and communicate next steps to the consumer.
* It should retry eligible failed payments after the configured wait period.
* It should skip failed installments safely when the next due date is too close.
* It should track consecutive skips and send the correct communication when needed.

## How It Should Not Work

* It should not retry failed payments immediately without respecting retry rules.
* It should not charge a skipped or held schedule transaction as if it were still due today.
* It should not leave consumers without communication after important payment failures.

## Developer Notes

* ReprocessConsumerFailedPaymentsCommand is scheduled daily at 21:00.
* NextPaymentDueSoonSkipFailedScheduledCommand is scheduled daily at 2:30.
* RestartPaymentPlanCommand is scheduled daily at 4:00 for held plans with restart dates.

## Related App Areas

* `app/Console/Commands/ReprocessConsumerFailedPaymentsCommand.php`
* `app/Console/Commands/NextPaymentDueSoonSkipFailedScheduledCommand.php`
* `app/Console/Commands/RestartPaymentPlanCommand.php`
* `app/Jobs/SkipScheduleTransactionJob.php`
* `app/Services/ScheduledCommunicationService.php`
