@startuml

' declaring skinparam
skinparam sequenceMessageAlign center
skinparam shadowing false
skinparam defaultFontName Verdana
skinparam monochrome true
skinparam SequenceLifeLineBackgroundColor WhiteSmoke
skinparam SequenceLifeLineBorderColor Black
skinparam ParticipantFontStyle Bold
skinparam ParticipantFontSize 20
skinparam ParticipantBackgroundColor WhiteSmoke
skinparam ArrowColor Black

hide footbox

title Transfer: 1.2.3 Rejected Authorization

box "PISP"
participant "PISP Server" as D1
end box
box "Mojaloop"
    participant Switch as S
end box
box "DFSP A"
    participant "DFSP A\n(Payer)" as D2
end box
== Agreement Phase ==
note right of D1
  PISP looks up the ""transactionRequestId"" and
  checks the quote with the user,
  
  
  User rejects the terms of the transcationRequest
end note

rnote right of D1 #Light
**""PUT /thirdpartyRequests/authorizations/33333333-0000-0000-0000-000000000000""**
""FSPIOP-Source: pispa""
""FSPIOP-Destination: dfspa""
{
  "responseType": "REJECTED"
}
end note
D1 -> S: ""PUT /thirdpartyRequests/authorizations/33333333-0000-0000-0000-000000000000""
S --> D1: ""200 OK""
S -> D2: ""PUT /thirdpartyRequests/authorizations""\n""/33333333-0000-0000-0000-000000000000""
D2 --> S: ""200 OK""

D2 -> D2: Look up the ""transactionRequestId"" for this ""authorizationId""

note over D2
  User has rejected the transaction request. 
end note

rnote over D2 #Light
**""PATCH /thirdpartyRequests/transactions/00000000-0000-0000-0000-000000000000""**
""FSPIOP-Source: dfspa""
""FSPIOP-Destination: pispa""
{
  "transactionRequestState": "REJECTED",
  "transactionId": "11111111-0000-0000-0000-000000000000",
}
end note
D2 -> S: ""PATCH /thirdpartyRequests/transactions""\n""   /00000000-0000-0000-0000-000000000000""
S --> D2: ""200 OK""

S -> D1: ""PATCH /thirdpartyRequests/transactions""\n""   /00000000-0000-0000-0000-000000000000""
D1 --> S: ""200 OK""

note over D1 
  PISP can inform the user the transaction did not proceed
end note


@enduml
