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

# Payment Complete

> Jane finishes a payment setup or one-time payment and lands on Payment Complete.

## Real-World Example

Jane finishes a payment setup or one-time payment and lands on Payment Complete. The page should confirm the result, show the right next step, and avoid implying that a failed or pending payment succeeded.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Payment setup or payment returns complete"] --> B["Portal checks final payment state"]
    B --> C{"Payment successful or scheduled?"}
    C -->|Yes| D["Consumer sees completion confirmation"]
    C -->|No| E["Portal shows safe next step or error"]
    D --> F["Account status is updated"]
    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,D,E,F system;
    class C decision;
    class E risk;
    class F outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should confirm successful payment setup, completed payment, or scheduled plan creation accurately.
* It should route the consumer back to My Accounts, schedule details, or history as appropriate.
* It should keep the displayed result aligned with the actual payment state.

## How It Should Not Work

* It should not display success when payment setup failed.
* It should not duplicate payments when a consumer refreshes the completion page.
* It should not leave the account in the wrong My Accounts tab after completion.

## Developer Notes

* Completion pages should be idempotent and status-aware.
* Gateway response and internal schedule/payment state must be reconciled before showing final success language.

## Related App Areas

* `app/Livewire/Consumer/PaymentComplete.php`
* `app/Services/Consumer/PaymentSettlementCompletionService.php`
* `app/Services/Consumer/PaymentSetupCompletionService.php`
