io.paymenthighway.sdk.util / CallbackResult

CallbackResult

class CallbackResult<T> : Callback<T>

Helper for connecting the Retrofit2 Callback into Result completion

Parameters

T - the type of the data for success operation

completion - sdk callback result

Constructors

<init>

CallbackResult(completion: (Result<T, Exception>) -> Unit)

Helper for connecting the Retrofit2 Callback into Result completion

Properties

completion

val completion: (Result<T, Exception>) -> Unit

sdk callback result

Functions

onFailure

fun onFailure(call: Call<T>, t: Throwable): Unit

Implementation of the Retrofit2 onFailure Callback

onResponse

fun onResponse(call: Call<T>, response: Response<T>): Unit

Implementation of the Retrofit2 onResponse Callback