to Payment Method
Converts the data string to a PaymentMethod instance.
when (forageApiResponse) {
is ForageApiResponse.Success -> {
val paymentMethod = forageApiResponse.toPaymentMethod()
// Unpack paymentMethod.ref, paymentMethod.card, etc.
val card = paymentMethod.card
// Unpack card.last4, ...
if (card is EbtCard) {
// Unpack ebtCard.usState, ...
}
}
}
Content copied to clipboard
Return
A PaymentMethod instance.