Success

data class Success<out T>(val data: T) : ForageApiResponse<T>

A model that represents a success response from the API.

In most cases, data is a string representation of a JSON object from the Forage API, for example:

if (response is ForageApiResponse.Success) {
response.data // { "ref": "abcde123", ... }
}

Use the toPaymentMethod, toBalance, or toPayment methods to convert the data string to a PaymentMethod, Balance, or Payment instance, respectively.

Constructors

Link copied to clipboard
constructor(data: T)

Properties

Link copied to clipboard
val data: T

Functions

Link copied to clipboard

Converts the data string to a Balance instance.

Link copied to clipboard

Converts the data string to a Payment instance.

Link copied to clipboard

Converts the data string to a PaymentMethod instance.