package Ġcom . template . flows Ċ Ċ import Ġco . parallel universe . fib ers . Suspend able Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . contracts . commands . O bl igation Commands Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . contracts . states . O bl igation Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . contracts . types . Off Ledger Payment Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . contracts . types . Payment Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . contracts . types . Payment Reference Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . contracts . types . Payment Status Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . oracle . flows . Verify Set tlement Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . workflows . flows . Make Off Ledger Payment Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . workflows . flows . Nov ate O bl igation Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . workflows . flows . Off Ledger Set tle O bl igation Ċ import Ġcom . r 3 . cord a . finance . ob lig ation . workflows . flows . Update Set tlement Method Ċ import Ġcom . r 3 . cord a . lib . tokens . contracts . types . TokenType Ċ import Ġcom . r 3 . cord a . lib . tokens . money . Fi at Currency Ċ import Ġcom . r 3 . cord a . lib . tokens . workflows . utilities . to Party Ċ import Ġcom . template . states . IO U State Ċ import Ġcom . template . states . IO U Token Ċ import Ġnet . cord a . core . contracts . Amount Ċ import Ġnet . cord a . core . contracts . State And Ref Ċ import Ġnet . cord a . core . contracts . Unique Identifier Ċ import Ġnet . cord a . core . flows . Flow Exception Ċ import Ġnet . cord a . core . flows . Flow Logic Ċ import Ġnet . cord a . core . identity . C ord a X 5 0 0 Name Ċ import Ġnet . cord a . core . identity . Party Ċ import Ġnet . cord a . core . node . App Service Hub Ċ import Ġnet . cord a . core . node . services . C ord a Service Ċ import Ġnet . cord a . core . serialization . Singleton Serialize As Token Ċ import Ġnet . cord a . core . transactions . Signed Transaction Ċ import Ġnet . cord a . core . transactions . Transaction Builder Ċ import Ġnet . cord a . core . transactions . Wire Transaction Ċ import Ġnet . cord a . core . utilities . Progress Tracker Ċ Ċ class ĠC ord a Set t ler Nov ate IO U Flow ( ĊĠĠĠĠĠĠĠ Ġval Ġi ou : ĠIO U State Ċ ) Ġ Ġ: ĠFlow Logic < Wire Transaction >() Ġ{ ĊĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠWire Transaction Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoracle Name Ġ= ĠC ord a X 5 0 0 Name (" Exchange Rate Oracle Service ", Ġ" New ĠYork "," US ") ĊĊĠĠĠĠĠĠĠ Ġ// ĠPlace holder Ġcode Ġto Ġavoid Ġtype Ġerror Ġwhen Ġrunning Ġthe Ġtests . ĠRemove Ġbefore Ġstarting Ġthe Ġflow Ġtask ! ĊĠĠĠĠĠĠĠ Ġreturn Ġservice Hub . sign Initial Transaction ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTransaction Builder ( not ary Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġ). tx ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠC ord a Set t ler Update Set tlement Method Flow ( ĊĠĠĠĠĠĠĠ Ġval Ġnov ated I ou : ĠO bl igation < TokenType >, ĊĠĠĠĠĠĠĠ Ġval Ġaccount To Pay : ĠString Ċ ) Ġ: ĠFlow Logic < Wire Transaction >() Ġ{ ĊĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠWire Transaction Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠPlace holder Ġcode Ġto Ġavoid Ġtype Ġerror Ġwhen Ġrunning Ġthe Ġtests . ĠRemove Ġbefore Ġstarting Ġthe Ġflow Ġtask ! ĊĠĠĠĠĠĠĠ Ġreturn Ġservice Hub . sign Initial Transaction ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTransaction Builder ( not ary Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġ). tx ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠC ord a Set t ler Bank Api Set tlement ( ĊĠĠĠĠĠĠĠ Ġval Ġnov ated I ou : ĠO bl igation < TokenType > Ċ ) Ġ: ĠFlow Logic < Wire Transaction >() Ġ{ ĊĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠWire Transaction Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠPlace holder Ġcode Ġto Ġavoid Ġtype Ġerror Ġwhen Ġrunning Ġthe Ġtests . ĠRemove Ġbefore Ġstarting Ġthe Ġflow Ġtask ! ĊĠĠĠĠĠĠĠ Ġreturn Ġservice Hub . sign Initial Transaction ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTransaction Builder ( not ary Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġ). tx ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ C ord a Service Ċ class ĠBank Api Oracle Service ( val Ġservices : ĠApp Service Hub ) Ġ: ĠSingleton Serialize As Token () Ġ{ ĊĠĠĠ Ġ// ĠAPI Ġmethods Ġhere ĊĊĠĠĠ Ġprivate Ġfun Ġcheck Ob li gee Received Payment ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpayment : ĠBank Api Payment < TokenType >, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoblig ation : ĠIO U State ĊĠĠĠ Ġ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfalse ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġhas Payment Set tled ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpayment : ĠBank Api Payment < TokenType >, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoblig ation : ĠIO U State ĊĠĠĠ Ġ): ĠVerify Set tlement . Verify Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠVerify Set tlement . Verify Result . RE JECT ED ĊĠĠĠ Ġ} Ċ } Ċ Ċ data Ġclass ĠBank Api Payment < T Ġ: ĠTokenType >( ĊĠĠĠĠĠĠĠ Ġoverride Ġval Ġpayment Reference : ĠPayment Reference , ĊĠĠĠĠĠĠĠ Ġoverride Ġval Ġamount : ĠAmount < T >, ĊĠĠĠĠĠĠĠ Ġoverride Ġvar Ġstatus : ĠPayment Status Ġ= ĠPayment Status . SENT Ċ ) Ġ: ĠPayment < T > Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠtoString (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ" Amount : Ġ$ amount , ĠPayment ĠReference : Ġ$ payment Reference , ĠStatus : Ġ$ status " ĊĠĠĠ Ġ} Ċ } Ċ Ċ data Ġclass ĠBank Api Set tlement ( ĊĠĠĠĠĠĠĠ Ġoverride Ġval Ġaccount To Pay : ĠString , ĊĠĠĠĠĠĠĠ Ġoverride Ġval Ġset tlement Oracle : ĠParty , ĊĠĠĠĠĠĠĠ Ġoverride Ġval Ġpayment Flow : ĠClass < Make Bank Api Payment <* >> Ġ= ĠMake Bank Api Payment :: class . java Ċ ) Ġ: ĠOff Ledger Payment < Make Bank Api Payment <* >> Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠtoString (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ" Pay ĠBank Ġaddress Ġ$ account To Pay Ġand Ġuse Ġ$ set tlement Oracle Ġas Ġset tlement ." ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠMake Bank Api Payment < T Ġ: ĠTokenType >( ĊĠĠĠĠĠĠĠ Ġamount : ĠAmount < T >, ĊĠĠĠĠĠĠĠ Ġoblig ation State And Ref : ĠState And Ref < O bl igation <* >>, ĊĠĠĠĠĠĠĠ Ġset tlement Method : ĠOff Ledger Payment <* >, ĊĠĠĠĠĠĠĠ Ġprogress Tracker : ĠProgress Tracker Ġ= ĠMake Off Ledger Payment . tracker () Ċ ) Ġ: ĠMake Off Ledger Payment < T >( amount , Ġoblig ation State And Ref , Ġset tlement Method ) Ġ{ ĊĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġsetup () Ġ{ ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġcheck Balance ( required Amount : ĠAmount <* >) Ġ{ ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġmake Payment ( ob lig ation : ĠO bl igation <* >, Ġamount : ĠAmount < T >): ĠBank Api Payment < T > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBank Api Payment (" payment Reference Here ", Ġamount , ĠPayment Status . FAILED ) ĊĠĠĠ Ġ} Ċ }