State Machine Diagrams
Siparis ve odeme durum gecisleri - lifecycle yonetimi
Order State Machine
State MachineSiparis yasam dongusu. Created → Pending Payment → Paid → Confirmed → Ready → Completed. Iptal ve iade durumlari dahil.
Created
Pending Payment
Processing
Paid
Confirmed
Ready
Completed
Payment Failed
Cancelled
Refunded
stateDiagram-v2
[*] --> Created: Sepet olusturuldu
Created --> PendingPayment: checkout
PendingPayment --> Processing: pay
PendingPayment --> Cancelled: timeout/cancel
Processing --> Paid: success
Processing --> PaymentFailed: fail
PaymentFailed --> PendingPayment: retry
PaymentFailed --> Cancelled: abandon
Paid --> Confirmed: confirm
Paid --> Refunded: refund
Confirmed --> Ready: prepare
Confirmed --> Refunded: refund
Ready --> Completed: deliver
Completed --> [*]
Cancelled --> [*]
Refunded --> [*]
note right of Created
Kullanici sepete urun ekledi
end note
note right of PendingPayment
Odeme zaman asimi: 15 dakika
end note
note right of Refunded
Iade: sadece odeme sonrasi,
teslimden once
end note
State Aciklamalari
- Created: Sepet olusturuldu
- PendingPayment: Odeme bekleniyor (15 dk timeout)
- Processing: Odeme isleniyor
- Paid: Odeme tamamlandi
- Confirmed: Siparis onaylandi
- Ready: Hazirlandi
- Completed: Teslim edildi (Final)
- PaymentFailed: Odeme basarisiz
- Cancelled: Iptal edildi (Final)
- Refunded: Iade edildi (Final)
Transitions
| From | To | Trigger | Type |
|---|---|---|---|
| Created | Pending Payment | checkout | Normal |
| Pending Payment | Processing | pay | Normal |
| Processing | Paid | success | Normal |
| Processing | Payment Failed | fail | Error |
| Payment Failed | Pending Payment | retry | Conditional |
| Paid | Confirmed | confirm | Normal |
| Confirmed | Ready | prepare | Normal |
| Ready | Completed | deliver | Normal |
| Pending Payment | Cancelled | timeout/cancel | Error |
| Paid | Refunded | refund | Conditional |
| Confirmed | Refunded | refund | Conditional |
Payment State Machine
State MachineOdeme yasam dongusu. Initiated → Pending → Processing (3D Secure) → Authorized → Captured → Settled. Iptal, hata ve iade durumlari dahil.
Initiated
Pending
Processing
Authorized
Captured
Settled
Failed
Cancelled
Refund Pending
Refunded
Partial Refund
stateDiagram-v2
[*] --> Initiated: Odeme baslatildi
Initiated --> Pending: submit
Pending --> Processing: 3D Secure
Pending --> Failed: reject
Processing --> Authorized: authorize
Processing --> Failed: error
Authorized --> Captured: capture
Authorized --> Cancelled: void
Captured --> Settled: settle
Captured --> RefundPending: refund request
RefundPending --> Refunded: full refund
RefundPending --> PartialRefund: partial
PartialRefund --> RefundPending: more refund
PartialRefund --> Refunded: complete
Settled --> [*]
Failed --> [*]
Cancelled --> [*]
Refunded --> [*]
note right of Processing
3D Secure: Tum kartlar icin zorunlu
end note
note right of Settled
Settlement: T+1 banka gunu
end note
State Aciklamalari
- Initiated: Odeme baslatildi
- Pending: Onay bekleniyor
- Processing: Banka islemi (3D Secure)
- Authorized: Yetkilendirildi
- Captured: Tahsil edildi
- Settled: Hesaba aktarildi (Final)
- Failed: Basarisiz (Final)
- Cancelled: Iptal edildi (Final)
- RefundPending: Iade bekleniyor
- Refunded: Iade edildi (Final)
- PartialRefund: Kismi iade
Transitions
| From | To | Trigger | Type |
|---|---|---|---|
| Initiated | Pending | submit | Normal |
| Pending | Processing | 3D Secure | Normal |
| Processing | Authorized | authorize | Normal |
| Authorized | Captured | capture | Normal |
| Captured | Settled | settle | Normal |
| Pending | Failed | reject | Error |
| Processing | Failed | error | Error |
| Authorized | Cancelled | void | Error |
| Captured | Refund Pending | refund request | Conditional |
| Refund Pending | Refunded | full refund | Normal |
| Refund Pending | Partial Refund | partial | Conditional |
| Partial Refund | Refunded | complete | Normal |