Skip to content

Instantly share code, notes, and snippets.

@brenden-t-r
Created August 17, 2019 21:53
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/56af8a9ccd48c784d596015959c1746e to your computer and use it in GitHub Desktop.
Save brenden-t-r/56af8a9ccd48c784d596015959c1746e to your computer and use it in GitHub Desktop.
abstract class CustomMakeOffLedgerPayment<T: TokenType>(
val amount: Amount<T>,
private val obligationStateAndRef: StateAndRef<Obligation<*>>,
open val settlementMethod: OffLedgerPayment<*>,
override val progressTracker: ProgressTracker = MakeOffLedgerPayment.tracker()
): MakeOffLedgerPayment<T>(amount, obligationStateAndRef, settlementMethod, progressTracker) {
@Suspendable
override fun setup() {
// Perform any setup tasks needed for your payment rail
}
@Suspendable
override fun checkBalance(requiredAmount: Amount<*>) {
// Use CordaService API to check balances and verify funds exist.
}
@Suspendable
override fun makePayment(obligation: Obligation<*>, amount: Amount<T>): Payment<T> {
// Initiate payment on off-ledger payment rail
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment