> ## 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.

# Installment Payment Processing

> Jane has an installment payment due tonight.

## Real-World Example

Jane has an installment payment due tonight. The scheduled payment command runs, checks that her account and payment method are eligible, then dispatches the correct merchant job for Authorize.net, Stripe, USAePay, or Tilled.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Installment payment becomes due"] --> B["Daily payment command runs at 19:00"]
    B --> C["Portal checks consumer, offer, merchant, and payment profile"]
    C --> D{"Payment eligible?"}
    D -->|Yes| E["Merchant-specific queued job runs"]
    D -->|No| F["Payment is skipped or held safely"]
    E --> G["Transaction success or failure is recorded"]
    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,E,F,G system;
    class D decision;
    class F risk;
    class G outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should process due schedule transactions through the scheduled command and merchant-specific queued jobs.
* It should check consumer status, accepted offer, merchant configuration, and payment profile before charging.
* It should record success, failure, attempts, and payment history consistently.
* It should avoid overlapping processing for the same scheduled transaction.

## How It Should Not Work

* It should not charge consumers whose plans are on hold or not eligible for processing.
* It should not process the same scheduled transaction twice at the same time.
* It should not bypass gateway-specific services or payment profile rules.

## Developer Notes

* ProcessConsumerPaymentsCommand is scheduled daily at 19:00.
* Merchant jobs implement queued payment processing and share the ProcessesScheduleTransactionPayments concern.
* Held plans dispatch skip behavior instead of normal payment processing.

## Related App Areas

* `app/Console/Kernel.php`
* `app/Console/Commands/ProcessConsumerPaymentsCommand.php`
* `app/Jobs/AuthorizeSchedulePaymentJob.php`
* `app/Jobs/StripeSchedulePaymentJob.php`
* `app/Jobs/USAEpaySchedulePaymentJob.php`
* `app/Jobs/TilledSchedulePaymentJob.php`
* `app/Jobs/Concerns/ProcessesScheduleTransactionPayments.php`
