Skip to content

Instantly share code, notes, and snippets.

@jccguimaraes
Last active February 23, 2019 09:46
Show Gist options
  • Save jccguimaraes/d91fc38e53388eeeb57d3e7ee649f6b8 to your computer and use it in GitHub Desktop.
Save jccguimaraes/d91fc38e53388eeeb57d3e7ee649f6b8 to your computer and use it in GitHub Desktop.
PlantUML /capture sequence diagram
@startuml
participant "USER" as A
participant "MS" as B
participant "API" as C
title //process-transactions// micro-service capture workflow
rnote left A
**headers**
X-Api-Key<font color="red">*</font> //<string>//
X-Correlation-Id //<string>//
end note
activate A
A -> B: **POST** ""/capture/:authorizationId""
rnote left A
**payload**
accountId:<font color="red">*</font> //<string>//
amount:<font color="red">*</font> //<number>//
currency:<font color="red">*</font> //<string>//
end note
rnote left B
**headers**
X-Api-Key<font color="red">*</font> //<string>//
X-Correlation-Id //<string>//
end note
activate B
B -> C: **POST** ""/validate""
rnote left B
**payload**
accountId:<font color="red">*</font> //<string>//
authorizationId:<font color="red">*</font> //<string>//
end note
alt success request
rnote right B
**headers**
X-Correlation-Id //<string>//
end note
activate C
B <-- C: ""**200** OK""
rnote right B
**payload**
success: //true//
end note
|||
B -> B: capture amount
activate B
deactivate B
rnote right A
**headers**
X-Correlation-Id //<string>//
end note
A <-- B: ""**200** OK""
rnote right A
**payload**
transactionId: //<string>//
end note
|||
else failure request
rnote right B
**headers**
X-Correlation-Id //<string>//
end note
B <-- C: ""**200** OK""
deactivate C
rnote right B
**payload**
success: //false//
end note
rnote right A
**headers**
X-Correlation-Id //<string>//
end note
A <-- B: ""**422** UNPROCESSABLE ENTITY""
deactivate B
rnote right A
**payload**
error: //true//
reason: Conditions could not be met
end note
|||
end
deactivate A
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment