Skip to content

Commit

Permalink
Feature/#1334 patch request notif (#230)
Browse files Browse the repository at this point in the history
* added diagrams for transfer reject flow for spec v1.1

* added some clarification text

* added md for the reject/abort sequence

* added changes to SUMMARY.md

* link errors

* added documentation for v1.1 for request notification functionallity

* fixed typo in file name

* added alternative messages for reserve and commit put request from payee

* added notification on 'reserve' action

* bumped up version

* Update mojaloop-technical-overview/central-ledger/assets/diagrams/sequence/seq-fulfil-2.1.0-v1.1.plantuml

Co-authored-by: Sam <10507686+elnyry-sam-k@users.noreply.github.com>

* Update mojaloop-technical-overview/central-ledger/assets/diagrams/sequence/seq-fulfil-2.1.0-v1.1.plantuml

Co-authored-by: Sam <10507686+elnyry-sam-k@users.noreply.github.com>

* Update mojaloop-technical-overview/central-ledger/assets/diagrams/sequence/seq-fulfil-2.1.1-v1.1.plantuml

Co-authored-by: Sam <10507686+elnyry-sam-k@users.noreply.github.com>

* contributor name added

* added contributor name to list

* added contributor name to list

* Updated SUMMARY.md

* Fixed typo

Co-authored-by: Valentin <valentin.genev@modusbox.com>
Co-authored-by: Sam <10507686+elnyry-sam-k@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 6, 2020
1 parent f16584e commit 6dbf236
Show file tree
Hide file tree
Showing 15 changed files with 1,083 additions and 155 deletions.
5 changes: 5 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@
* [Prepare Handler Consume (a)](mojaloop-technical-overview/central-ledger/transfers/1.1.1.a-prepare-handler-consume.md)
* [Prepare Handler Consume (b)](mojaloop-technical-overview/central-ledger/transfers/1.1.1.b-prepare-handler-consume.md)
* [Prepare Position Handler](mojaloop-technical-overview/central-ledger/transfers/1.3.0-position-handler-consume.md)
* [Prepare Position Handler v1.1](mojaloop-technical-overview/central-ledger/transfers/1.3.0-position-handler-consume-v1.1.md)
* [Prepare Position Handler](mojaloop-technical-overview/central-ledger/transfers/1.3.1-prepare-position-handler-consume.md)
* [Position Handler Consume (a)](mojaloop-technical-overview/central-ledger/transfers/1.1.2.a-position-handler-consume.md)
* [Position Handler Consume (b)](mojaloop-technical-overview/central-ledger/transfers/1.1.2.b-position-handler-consume.md)
* [Fulfil Handler](mojaloop-technical-overview/central-ledger/transfers/2.1.0-fulfil-transfer-request.md)
* [Fulfil Handler v1.1](mojaloop-technical-overview/central-ledger/transfers/2.1.0-fulfil-transfer-request-v1.1.md)
* [Fulfil Handler Consume](mojaloop-technical-overview/central-ledger/transfers/2.1.1-fulfil-handler-consume.md)
* [Fulfil Handler Consume v1.1](mojaloop-technical-overview/central-ledger/transfers/2.1.1-fulfil-handler-consume-v1.1.md)
* [Fulfil Position Handler](mojaloop-technical-overview/central-ledger/transfers/1.3.0-position-handler-consume.md)
* [Fulfil Position Handler](mojaloop-technical-overview/central-ledger/transfers/1.3.2-fulfil-position-handler-consume.md)
* [Fulfil Position Handler v1.1](mojaloop-technical-overview/central-ledger/transfers/1.3.2-fulfil-position-handler-consume-v1.1.md)
* [Fulfil Reject Transfer](mojaloop-technical-overview/central-ledger/transfers/2.2.0-fulfil-reject-transfer.md)
* [Fulfil Reject Transfer (a)](mojaloop-technical-overview/central-ledger/transfers/2.2.0.a-fulfil-abort-transfer.md)
* [Fulfil Handler (Reject-Abort)](mojaloop-technical-overview/central-ledger/transfers/2.2.1-fulfil-reject-handler.md)
Expand All @@ -70,6 +74,7 @@
* [Fulfil Handler (Reject-Abort) v1.1](mojaloop-technical-overview/central-ledger/transfers/2.2.1-fulfil-reject-handler-v1.1.md)
* [Notifications]()
* [Notification to Participant (a)](mojaloop-technical-overview/central-ledger/transfers/1.1.4.a-send-notification-to-participant.md)
* [Notification to Participant (a) - v1.1](mojaloop-technical-overview/central-ledger/transfers/1.1.4.a-send-notification-to-participant-v1.1.md)
* [Notification to Participant (b)](mojaloop-technical-overview/central-ledger/transfers/1.1.4.b-send-notification-to-participant.md)
* [Reject/Abort]()
* [Abort Position Handler](mojaloop-technical-overview/central-ledger/transfers/1.3.3-abort-position-handler-consume.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
/'
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
- Name Surname <name.surname@gatesfoundation.com>
* Georgi Georgiev <georgi.georgiev@modusbox.com>
* Valentin Genev <valentin.genev@modusbox.com>
--------------
'/


@startuml
' declate title
title 2.1.0. DFSP2 sends a Fulfil Success Transfer request v1.1

autonumber
' Actor Keys:
' boundary - APIs/Interfaces, etc
' collections - Kafka Topics
' control - Kafka Consumers
' entity - Database Access Objects
' database - Database Persistance Store

' declare actors
actor "DFSP1\nPayer" as DFSP1
actor "DFSP2\nPayee" as DFSP2
boundary "ML API Adapter" as MLAPI
control "ML API Notification Event Handler" as NOTIFY_HANDLER
boundary "Central Service API" as CSAPI
collections "topic-fulfil" as TOPIC_FULFIL
control "Fulfil Event Handler" as FULF_HANDLER
collections "topic-\nsettlement-model" as TOPIC_SETMODEL
control "Settlement Model\nHandler" as SETMODEL_HANDLER
collections "topic-\ntransfer-position" as TOPIC_TRANSFER_POSITION
control "Position Handler" as POS_HANDLER
collections "topic-\nnotification" as TOPIC_NOTIFICATIONS

box "Financial Service Providers" #lightGray
participant DFSP1
participant DFSP2
end box

box "ML API Adapter Service" #LightBlue
participant MLAPI
participant NOTIFY_HANDLER
end box

box "Central Service" #LightYellow
participant CSAPI
participant TOPIC_FULFIL
participant FULF_HANDLER
participant TOPIC_SETMODEL
participant SETMODEL_HANDLER
participant TOPIC_TRANSFER_POSITION
participant POS_HANDLER
participant TOPIC_NOTIFICATIONS
end box

' start flow
activate NOTIFY_HANDLER
activate FULF_HANDLER
activate SETMODEL_HANDLER
activate POS_HANDLER
group DFSP2 sends a request for notification after tranfer is being committed in the Switch
DFSP2 <-> DFSP2: Retrieve fulfilment string generated during\nthe quoting process or regenerate it using\n**Local secret** and **ILP Packet** as inputs
alt Send back notification reserve request
note right of DFSP2 #yellow
Headers - transferHeaders: {
Content-Length: <Content-Length>,
Content-Type: <Content-Type>,
Date: <Date>,
X-Forwarded-For: <X-Forwarded-For>,
FSPIOP-Source: <FSPIOP-Source>,
FSPIOP-Destination: <FSPIOP-Destination>,
FSPIOP-Encryption: <FSPIOP-Encryption>,
FSPIOP-Signature: <FSPIOP-Signature>,
FSPIOP-URI: <FSPIOP-URI>,
FSPIOP-HTTP-Method: <FSPIOP-HTTP-Method>
}

Payload - transferMessage:
{
"fulfilment": <IlpFulfilment>,
"transferState": "RESERVED"
"extensionList": {
"extension": [
{
"key": <string>,
"value": <string>
}
]
}
}
end note
else Send back commit request

note right of DFSP2 #yellow
Headers - transferHeaders: {
Content-Length: <Content-Length>,
Content-Type: <Content-Type>,
Date: <Date>,
X-Forwarded-For: <X-Forwarded-For>,
FSPIOP-Source: <FSPIOP-Source>,
FSPIOP-Destination: <FSPIOP-Destination>,
FSPIOP-Encryption: <FSPIOP-Encryption>,
FSPIOP-Signature: <FSPIOP-Signature>,
FSPIOP-URI: <FSPIOP-URI>,
FSPIOP-HTTP-Method: <FSPIOP-HTTP-Method>
}

Payload - transferMessage:
{
"fulfilment": <IlpFulfilment>,
"completedTimestamp": <DateTime>,
"transferState": "COMMITTED"
"extensionList": {
"extension": [
{
"key": <string>,
"value": <string>
}
]
}
}
end note
end
DFSP2 ->> MLAPI: PUT - /transfers/<ID>
activate MLAPI
MLAPI -> MLAPI: Validate incoming token and originator matching Payee\n<color #FF0000><b>Error codes:</b> 3000-3002, 3100-3107</color>
note right of MLAPI #yellow
Message:
{
id: <ID>,
from: <transferHeaders.FSPIOP-Source>,
to: <transferHeaders.FSPIOP-Destination>,
type: application/json,
content: {
headers: <transferHeaders>,
payload: <transferMessage>
},
metadata: {
event: {
id: <uuid>,
type: fulfil,
action: reserve || commit,
createdAt: <timestamp>,
state: {
status: "success",
code: 0
}
}
}
}
end note
MLAPI -> TOPIC_FULFIL: Route & Publish Fulfil event for Payee\n<color #FF0000><b>Error code:</b> 2003</color>
activate TOPIC_FULFIL
TOPIC_FULFIL <-> TOPIC_FULFIL: Ensure event is replicated as configured (ACKS=all)\n<color #FF0000><b>Error code:</b> 2003</color>
TOPIC_FULFIL --> MLAPI: Respond replication acknowledgements have been received
deactivate TOPIC_FULFIL
MLAPI -->> DFSP2: Respond HTTP - 200 (OK)
deactivate MLAPI
TOPIC_FULFIL <- FULF_HANDLER: Consume message
ref over TOPIC_FULFIL, TOPIC_TRANSFER_POSITION: Fulfil Handler Consume (Success) {[[https://github.com/mojaloop/documentation/tree/master/mojaloop-technical-overview/central-ledger/assets/diagrams/sequence/seq-fulfil-2.1.1-v1.1.svg 2.1.1-v1.1]]} \n
FULF_HANDLER -> TOPIC_SETMODEL: Produce message
FULF_HANDLER -> TOPIC_TRANSFER_POSITION: Produce message
|||
TOPIC_SETMODEL <- SETMODEL_HANDLER: Consume message
ref over TOPIC_SETMODEL, SETMODEL_HANDLER: Settlement Model Handler Consume (Success)\n
|||
TOPIC_TRANSFER_POSITION <- POS_HANDLER: Consume message
ref over TOPIC_TRANSFER_POSITION, TOPIC_NOTIFICATIONS: Position Handler Consume (Success)\n
POS_HANDLER -> TOPIC_NOTIFICATIONS: Produce message
|||
TOPIC_NOTIFICATIONS <- NOTIFY_HANDLER: Consume message
opt action == 'commit'
|||
ref over DFSP1, TOPIC_NOTIFICATIONS: Send notification to Participant (Payer)\n
NOTIFY_HANDLER -> DFSP1: Send callback notification
end
|||
TOPIC_NOTIFICATIONS <- NOTIFY_HANDLER: Consume message
opt action == 'reserve'
|||
ref over DFSP2, TOPIC_NOTIFICATIONS: Send notification to Participant (Payee)\n
NOTIFY_HANDLER -> DFSP2: Send callback notification
end
|||
end
deactivate POS_HANDLER
deactivate FULF_HANDLER
deactivate NOTIFY_HANDLER
@enduml
Loading

0 comments on commit 6dbf236

Please sign in to comment.