toPayment

Converts the data string to a Payment instance.

when (forageApiResponse) {
is ForageApiResponse.Success -> {
val payment = forageApiResponse.toPayment()
// Unpack payment.ref, payment.amount, payment.receipt, etc.
}
}

Return

A Payment instance.