-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate_machine.d2
More file actions
54 lines (45 loc) · 1.62 KB
/
Copy pathstate_machine.d2
File metadata and controls
54 lines (45 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
direction: down
title: Payment Processing State Machine {
near: top-center
shape: text
style.font-size: 22
style.bold: true
}
flow: "" {
direction: right
style.fill: transparent
style.stroke: transparent
main: Happy Path {
direction: down
style.fill: "#eef6ff"
style.stroke: "#6699cc"
initiated: INITIATED {style.fill: "#ddeeff"}
validating: VALIDATING {style.fill: "#ddeeff"}
authorizing: AUTHORIZING {style.fill: "#FFD700"}
capturing: CAPTURING {style.fill: "#FFD700"; style.bold: true}
settled: SETTLED {style.fill: "#90EE90"; style.bold: true}
refunded: REFUNDED {style.fill: "#cccccc"}
initiated -> validating
validating -> authorizing: payload ok
authorizing -> capturing: auth ok
capturing -> settled: capture ok
settled -> refunded: refund initiated
}
exceptions: Exception Handling {
direction: down
style.fill: "#fde8e8"
style.stroke: "#cc4444"
validation_failed: VALIDATION FAILED {style.fill: "#FFB6C1"}
auth_declined: AUTH DECLINED {style.fill: "#FFB6C1"}
capture_failed: CAPTURE FAILED {style.fill: "#FFB6C1"}
manual_review: MANUAL REVIEW {style.fill: "#ffcccc"; style.bold: true}
validation_failed -> manual_review
auth_declined -> manual_review
capture_failed -> manual_review
}
}
flow.main.validating -> flow.exceptions.validation_failed: invalid payload
flow.main.authorizing -> flow.exceptions.auth_declined: declined
flow.main.capturing -> flow.exceptions.capture_failed: gateway error
flow.exceptions.manual_review -> flow.main.initiated: retry approved
flow.main.refunded -> flow.main.initiated: refund completed