From 25e3869ff9c47f8d2a14227d539a2e8440af6a17 Mon Sep 17 00:00:00 2001 From: Steven Oderayi Date: Tue, 17 Dec 2024 17:10:06 +0100 Subject: [PATCH] doc: update fxquotes seq. diagram --- diagrams/fxquotes.puml | 44 ------------------------------------------ diagrams/fxquotes.svg | 2 +- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/diagrams/fxquotes.puml b/diagrams/fxquotes.puml index e90ab05b..258d84d3 100644 --- a/diagrams/fxquotes.puml +++ b/diagrams/fxquotes.puml @@ -85,49 +85,10 @@ note right of PayerCC "acceptParty": true } end note -D1->D1:Hmmm. I can only send in $payerCurrency.\nI need to get some currency conversion !else PayerCC->PayerCC:Hmmm. I can only send in $payerCurrency.\nI need to get some currency conversion -PayerCC->>D1:What FXPs do you know about?\n**GET /services/FXP** !endif -D1->>Services:What FXPs do you know about?\n**GET /services/FXP** -activate Services -!if ($simplified != true) -Services-->>D1:202 I'll get back to you -!endif -deactivate D1 -Services->ALSOracle:What FXPs do you know about? -activate ALSOracle -ALSOracle-->Services:FDH FX -deactivate ALSOracle -Services->>D1:Here are the available FXPs:FDH FX -note left of Services - PUT /services/FXP - { - "providers": [ - "$fxpID" - ] - } -end note -activate D1 -!if ($simplified != true) -D1-->>Services:200 Gotcha -!endif - -!if ($advancedCoreConnectorFlow != true) -' TODO: We can pause the execution here if required to allow the core connector to select the FXP -D1->D1:I'll ask FDH FX to perform my conversion -!else -D1->>PayerCC:Here are the available FXPs -note right of PayerCC - { - "providers": [ - "$fxpID" - ] - } -end note - PayerCC->PayerCC:I'll ask FDH FX to perform my conversion PayerCC->D1: I want to get a quote from this FXP\n**POST /fxQuotes** !if ($simplified != true) @@ -154,11 +115,6 @@ PayerCC->D1: I want to get a quote from this FXP\n**POST /fxQuotes** !endif !endif - -!endif - - - deactivate QS diff --git a/diagrams/fxquotes.svg b/diagrams/fxquotes.svg index e8c527d2..b5a798e5 100644 --- a/diagrams/fxquotes.svg +++ b/diagrams/fxquotes.svg @@ -1 +1 @@ -FX Quotes using Mojaloop FX APIsPayer DFSP requests conversion with SEND amountPayer DFSPMojaloop SwitchFX providerPayee DFSPTundeTundePayer CBSPayer CBSCore ConnectorCore ConnectorPayerMojaloopConnectorPayerMojaloopConnectorQuoting ServiceQuoting ServiceALSALSALS OracleALS OracleServicesServicesFXPConnectorFXPConnectorBackend FX APIBackend FX APIPayeeMojaloopConnectorPayeeMojaloopConnectorCore ConnectorCore ConnectorYaroYaro1I'd like to pay Yaro300 BWP, please2Initiate remittance transferCurrency conversion3Hmmm. I can only send in BWP.I need to get some currency conversion4What FXPs do you know about?GET /services/FXP5What FXPs do you know about?GET /services/FXP6202 I'll get back to you7What FXPs do you know about?8FDH FX9Here are the available FXPs:FDH FXPUT /services/FXP{"providers": ["FDH_FX"]}10200 Gotcha11Here are the available FXPs{"providers": ["FDH_FX"]}12I'll ask FDH FX to perform my conversion13I want to get a quote from this FXPPOST /fxQuotes{"homeTransactionId": "string","conversionRequestId": "828cc75f-1654-415e-8fcd-df76cc9329b9","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS"},"expiration": "2021-08-25T14:17:09.663+01:00"}}14Here is the initial version of the transfer.Please quote me for the currency conversion.post /fxQuotes{"conversionRequestId": "828cc75f-1654-415e-8fcd-df76cc9329b9","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS"},"expiration": "2021-08-25T14:17:09.663+01:00"}}15202 I'll get back to you16Here is the initial version of the transfer.Please quote me for the currency conversion.POST /fxQuote17202 I'll get back to you18Lookup FX ratepost /fxQuotes{"conversionRequestId": "828cc75f-1654-415e-8fcd-df76cc9329b9","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS"},"expiration": "2021-08-25T14:17:09.663+01:00"}}19Return FX rateI will add a 33 BWP fee for undertaking the conversion.Now I'll set an expiry time, sign the quotation object,{"conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS","amount": "48000"},"expiration": "2021-08-25T14:17:09.663+01:00""charges": [{"chargeType": "string","sourceAmount": {"currency": "BWP","amount": "33"},"targetAmount": {"currency": "TZS","amount": "6000"}}]}}Now I'll sign the quotation object,create an ILP prepare packet and return it in the intermediary object. NOTE: the ILP prepare packet contains the following items, all encoded:- The amount being sent (i.e. in the source currency)- An expiry time- The condition- The name of the FXP- The content of the conversion termsPUT /fxQuotes/828cc75f-1654-415e-8fcd-df76cc9329b9{"condition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS","amount": "48000"},"expiration": "2021-08-25T14:17:09.663+01:00""charges": [{"chargeType": "string","sourceAmount": {"currency": "BWP","amount": "33"},"targetAmount": {"currency": "TZS","amount": "6000"}}]}}20Here's the signed conversion object21200 Gotcha22Here's the signed conversion objectPUT /fxQuotes/828cc75f-1654-415e-8fcd-df76cc9329b923Gotcha24Here are the conversion terms{"homeTransactionId": "string","condition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS","amount": "48000"},"expiration": "2021-08-25T14:17:09.663+01:00""charges": [{"chargeType": "string","sourceAmount": {"currency": "BWP","amount": "33"},"targetAmount": {"currency": "TZS","amount": "6000"}}]}}Agreement Phase25I want to get a quote from the FSPPOST /quotes{"fspId": "PayeeFSP","quotesPostRequest": {"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payee": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "2551234567890","fspId": "PayeeFSP"},"name": "Yaro","personalInfo": {"complexName": {"firstName": "Yaro","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16","kycInformation": "<Encrypted KYC Data>"},"supportedCurrencies": [ "TZS" ]},"payer": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "26787654321","fspId": "PayerFSP"},"name": "Tunde","personalInfo": {"complexName": {"firstName": "Tunde","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16"}},"amountType": "SEND","amount": {"currency": "TZS","amount": "48000"},"converter": "PAYER","expiration": "2021-08-25T14:17:09.663+01:00"}}26Please quote for a transfer which sends 48000 TZS.POST /quotesPOST /quotes {"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payee": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "2551234567890","fspId": "PayeeFSP"},"name": "Yaro","personalInfo": {"complexName": {"firstName": "Yaro","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16","kycInformation": "<Encrypted KYC Data>"},"supportedCurrencies": [ "TZS" ]},"payer": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "26787654321","fspId": "PayerFSP"},"name": "Tunde","personalInfo": {"complexName": {"firstName": "Tunde","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16"}},"amountType": "SEND","amount": {"currency": "TZS","amount": "48000"},"converter": "PAYER","expiration": "2021-08-25T14:17:09.663+01:00"}27202 I'll get back to you28POST /quotes29202 I'll get back to you30POST /quoterequests{"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payee": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "2551234567890","fspId": "PayeeFSP"},"name": "Yaro","personalInfo": {"complexName": {"firstName": "Yaro","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16","kycInformation": "<Encrypted KYC Data>"},"supportedCurrencies": [ "TZS" ]},"payer": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "26787654321","fspId": "PayerFSP"},"name": "Tunde","personalInfo": {"complexName": {"firstName": "Tunde","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16"}},"amountType": "SEND","amount": {"currency": "TZS","amount": "48000"},"converter": "PAYER","expiration": "2021-08-25T14:17:09.663+01:00"}31OK, so I will charge 4000 TZS for this.Now I create terms of the transfer32Here are the terms{"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payeeFspFeeAmount": "4000","payeeFspFeeAmountCurrency": "TZS","payeeReceiveAmount": "44000","payeeReceiveAmountCurrency": "TZS","transferAmount": "48000","transferAmountCurrency": "TZS""expiration": "2021-08-25T14:17:09.663+01:00"}33Now I will sign the transaction object34Here's the signed quoteput /quotes/382987a8-75ce-4037-b500-c475e08c1727 {"transferAmount": {"currency": "TZS","amount": "48000"},"payeeReceiveAmount": {"currency": "TZS","amount": "44000"},"payeeFspFee": {"currency": "TZS","amount": "4000"},"expiration": "2021-08-25T14:17:09.663+01:00","ilpPacket": "<This is encoded transaction object. It contains data from quote request and response.>","condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks"} 35200 Gotcha36Here's the signed quotePUT /quotes/382987a8-75ce-4037-b500-c475e08c172737200 Gotcha38OK, I can see that there are going to be 4000 TZS in charges.Sender Confirmation39Here's the quote for the transferIt expires at 2021-08-25T14:17:09.663+01:00{"quotes": {"body": {"transferAmount": {"currency": "TZS","amount": "48000"},"payeeReceiveAmount": {"currency": "TZS","amount": "44000"},"payeeFspFee": {"currency": "TZS","amount": "4000"},"expiration": "2021-08-25T14:17:09.663+01:00","ilpPacket": "<This is encoded transaction object. It contains data from quote request and response.>","condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks"},"headers": {}},"currentState": "COMPLETED"}40Here's the quote41Hi, Tunde: I can do the transfer.It'll cost you 55 BWP(10000 TZS) in feesand Yaro will receive44000 TZS.Let me know if you want to go ahead42Great! Yes please, go ahead43Payer has accepted the terms please proceed \ No newline at end of file +FX Quotes using Mojaloop FX APIsPayer DFSP requests conversion with SEND amountPayer DFSPMojaloop SwitchFX providerPayee DFSPTundeTundePayer CBSPayer CBSCore ConnectorCore ConnectorPayerMojaloopConnectorPayerMojaloopConnectorQuoting ServiceQuoting ServiceALSALSALS OracleALS OracleServicesServicesFXPConnectorFXPConnectorBackend FX APIBackend FX APIPayeeMojaloopConnectorPayeeMojaloopConnectorCore ConnectorCore ConnectorYaroYaro1I'd like to pay Yaro300 BWP, please2Initiate remittance transferCurrency conversion3Hmmm. I can only send in BWP.I need to get some currency conversion4I'll ask FDH FX to perform my conversion5I want to get a quote from this FXPPOST /fxQuotes{"homeTransactionId": "string","conversionRequestId": "828cc75f-1654-415e-8fcd-df76cc9329b9","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS"},"expiration": "2021-08-25T14:17:09.663+01:00"}}6Here is the initial version of the transfer.Please quote me for the currency conversion.post /fxQuotes{"conversionRequestId": "828cc75f-1654-415e-8fcd-df76cc9329b9","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS"},"expiration": "2021-08-25T14:17:09.663+01:00"}}7202 I'll get back to you8Here is the initial version of the transfer.Please quote me for the currency conversion.POST /fxQuote9202 I'll get back to you10Lookup FX ratepost /fxQuotes{"conversionRequestId": "828cc75f-1654-415e-8fcd-df76cc9329b9","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS"},"expiration": "2021-08-25T14:17:09.663+01:00"}}11Return FX rateI will add a 33 BWP fee for undertaking the conversion.Now I'll set an expiry time, sign the quotation object,{"conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS","amount": "48000"},"expiration": "2021-08-25T14:17:09.663+01:00""charges": [{"chargeType": "string","sourceAmount": {"currency": "BWP","amount": "33"},"targetAmount": {"currency": "TZS","amount": "6000"}}]}}Now I'll sign the quotation object,create an ILP prepare packet and return it in the intermediary object. NOTE: the ILP prepare packet contains the following items, all encoded:- The amount being sent (i.e. in the source currency)- An expiry time- The condition- The name of the FXP- The content of the conversion termsPUT /fxQuotes/828cc75f-1654-415e-8fcd-df76cc9329b9{"condition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS","amount": "48000"},"expiration": "2021-08-25T14:17:09.663+01:00""charges": [{"chargeType": "string","sourceAmount": {"currency": "BWP","amount": "33"},"targetAmount": {"currency": "TZS","amount": "6000"}}]}}12Here's the signed conversion object13200 Gotcha14Here's the signed conversion objectPUT /fxQuotes/828cc75f-1654-415e-8fcd-df76cc9329b915Gotcha16Here are the conversion terms{"homeTransactionId": "string","condition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM","conversionTerms": {"conversionId": "581f68ef-b54f-416f-9161-ac34e889a84b","initiatingFsp": "PayerFSP","counterPartyFsp": "FDH_FX","amountType": "SEND","sourceAmount": {"currency": "BWP","amount": "300"},"targetAmount": {"currency": "TZS","amount": "48000"},"expiration": "2021-08-25T14:17:09.663+01:00""charges": [{"chargeType": "string","sourceAmount": {"currency": "BWP","amount": "33"},"targetAmount": {"currency": "TZS","amount": "6000"}}]}}Agreement Phase17I want to get a quote from the FSPPOST /quotes{"fspId": "PayeeFSP","quotesPostRequest": {"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payee": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "2551234567890","fspId": "PayeeFSP"},"name": "Yaro","personalInfo": {"complexName": {"firstName": "Yaro","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16","kycInformation": "<Encrypted KYC Data>"},"supportedCurrencies": [ "TZS" ]},"payer": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "26787654321","fspId": "PayerFSP"},"name": "Tunde","personalInfo": {"complexName": {"firstName": "Tunde","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16"}},"amountType": "SEND","amount": {"currency": "TZS","amount": "48000"},"converter": "PAYER","expiration": "2021-08-25T14:17:09.663+01:00"}}18Please quote for a transfer which sends 48000 TZS.POST /quotesPOST /quotes {"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payee": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "2551234567890","fspId": "PayeeFSP"},"name": "Yaro","personalInfo": {"complexName": {"firstName": "Yaro","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16","kycInformation": "<Encrypted KYC Data>"},"supportedCurrencies": [ "TZS" ]},"payer": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "26787654321","fspId": "PayerFSP"},"name": "Tunde","personalInfo": {"complexName": {"firstName": "Tunde","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16"}},"amountType": "SEND","amount": {"currency": "TZS","amount": "48000"},"converter": "PAYER","expiration": "2021-08-25T14:17:09.663+01:00"}19202 I'll get back to you20POST /quotes21202 I'll get back to you22POST /quoterequests{"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payee": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "2551234567890","fspId": "PayeeFSP"},"name": "Yaro","personalInfo": {"complexName": {"firstName": "Yaro","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16","kycInformation": "<Encrypted KYC Data>"},"supportedCurrencies": [ "TZS" ]},"payer": {"partyIdInfo": {"partyIdType": "MSISDN","partyIdentifier": "26787654321","fspId": "PayerFSP"},"name": "Tunde","personalInfo": {"complexName": {"firstName": "Tunde","middleName": "","lastName": ""},"dateOfBirth": "1966-06-16"}},"amountType": "SEND","amount": {"currency": "TZS","amount": "48000"},"converter": "PAYER","expiration": "2021-08-25T14:17:09.663+01:00"}23OK, so I will charge 4000 TZS for this.Now I create terms of the transfer24Here are the terms{"quoteId": "382987a8-75ce-4037-b500-c475e08c1727","transactionId": "d9ce59d4-3598-4396-8630-581bb0551451","payeeFspFeeAmount": "4000","payeeFspFeeAmountCurrency": "TZS","payeeReceiveAmount": "44000","payeeReceiveAmountCurrency": "TZS","transferAmount": "48000","transferAmountCurrency": "TZS""expiration": "2021-08-25T14:17:09.663+01:00"}25Now I will sign the transaction object26Here's the signed quoteput /quotes/382987a8-75ce-4037-b500-c475e08c1727 {"transferAmount": {"currency": "TZS","amount": "48000"},"payeeReceiveAmount": {"currency": "TZS","amount": "44000"},"payeeFspFee": {"currency": "TZS","amount": "4000"},"expiration": "2021-08-25T14:17:09.663+01:00","ilpPacket": "<This is encoded transaction object. It contains data from quote request and response.>","condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks"} 27200 Gotcha28Here's the signed quotePUT /quotes/382987a8-75ce-4037-b500-c475e08c172729200 Gotcha30OK, I can see that there are going to be 4000 TZS in charges.Sender Confirmation31Here's the quote for the transferIt expires at 2021-08-25T14:17:09.663+01:00{"quotes": {"body": {"transferAmount": {"currency": "TZS","amount": "48000"},"payeeReceiveAmount": {"currency": "TZS","amount": "44000"},"payeeFspFee": {"currency": "TZS","amount": "4000"},"expiration": "2021-08-25T14:17:09.663+01:00","ilpPacket": "<This is encoded transaction object. It contains data from quote request and response.>","condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks"},"headers": {}},"currentState": "COMPLETED"}32Here's the quote33Hi, Tunde: I can do the transfer.It'll cost you 55 BWP(10000 TZS) in feesand Yaro will receive44000 TZS.Let me know if you want to go ahead34Great! Yes please, go ahead35Payer has accepted the terms please proceed \ No newline at end of file