Skip to content

Instantly share code, notes, and snippets.

@brenden-t-r
Created August 17, 2019 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brenden-t-r/1977781a9d51527f79b886eb9a944f97 to your computer and use it in GitHub Desktop.
Save brenden-t-r/1977781a9d51527f79b886eb9a944f97 to your computer and use it in GitHub Desktop.
class VerifySettlement(private val otherSession: FlowSession) : FlowLogic<Unit>() {
// .. omitting ..
@Suspendable
override fun call() {
// .. omitting ..
// 4. Handle different settlement methods.
val verifyResult = when (settlementMethod) {
is XrpSettlement -> verifyXrpSettlement(obligation, lastPayment as XrpPayment<TokenType>)
is SwiftSettlement -> verifySwiftSettlement(lastPayment as SwiftPayment)
/* INCLUDE OUR SETTLEMENT RAIL HERE! */
is CustomSettlementMethod -> verifyCustomPaymentRailSettlement(..)
else -> throw IllegalStateException("Invalid settlement method $settlementMethod.")
}
// .. omitting ..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment