forked from mojaloop/sdk-scheme-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sequences.puml
99 lines (64 loc) · 2.13 KB
/
sequences.puml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@startuml
title Mojaloop SDK Interactions
autonumber
participant "DFSP Backend" as backend
participant "ESB/PortX" as esb
box "SDK"
participant "SDK Inbound Service" as sib
participant "SDK Outbound Service" as sob
end box
participant "Switch" as sw
note over sib, sob: All outbound between SDK and Switch have\nJWS added automatically
note over sib, sob: All inbound from switch have JWS validated
note over sib, sob: Mapping between scheme transaction types and DFSP\ntransaction types
note over sib, sob: JWS and TLS keys managed by SDK
== send money ==
backend -> sob: POST /transfers
sob -> sw: GET /parties
sw -> sob: PUT /parties
sob -> sw: POST /quotes
sw -> sob: PUT /quotes
sob -> sw: POST /transfers
sw -> sob: PUT /transfers
sob -> backend: HTTP 200
== query transfer ==
backend -> sob: GET /transfers/{ID}
sob -> sw: GET /transfers/{ID}
sw -> sob: PUT /transfers/{ID}
sob -> backend: transfer info
== receive money ==
sw -> sib: GET /parties
sib -> esb: GET /parties
esb -> backend: lookup user account
backend -> esb: user details
esb -> sib: user details
sib -> sw: PUT /parties
sw -> sib: POST /quotes
alt SDK handles quote request autonomously
sib -> sib: calculate quote
else backend calculates quote
sib -> esb: POST /quotes
esb -> backend: quote request
backend -> esb: quote response
esb -> sib: quote response
end
sib -> sib: create ILP packet\ncalculate condition
sib -> sw: PUT /quotes
sw -> sib: POST /transfers
sib -> sib: validate ILP
sib -> esb: POST /transfers
esb -> backend: accept money?
alt accepting money
backend -> esb: OK
esb -> sib: OK
sib -> sib: calculate ILP fulfilment
sib -> sw: PUT /transfers
sw -> sib: OK notification
sib -> esb: OK notification
esb -> backend: money received OK
else not accepting money
backend -> esb: NOK
esb -> sib: NOK
sib -> sw: PUT /transfers/{ID}/error
end
@enduml