ru.tinkoff.acquiring.sdk.utils.RequestResult.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Library which allows you to use internet acquiring in your android app
package ru.tinkoff.acquiring.sdk.utils
import ru.tinkoff.acquiring.sdk.responses.AcquiringResponse
sealed class RequestResult {
object NotYet: RequestResult()
class Success(val result: R) : RequestResult()
class Failure(val exception: Exception) : RequestResult()
fun process(onSuccess: (R) -> Unit, onFailure: (Exception) -> Unit) {
when (this) {
is Success -> onSuccess(result)
is Failure -> onFailure(exception)
else -> Unit
}
}
val isFinished get() = this !is NotYet
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy