getInstallments

suspend fun getInstallments(bin: String, amount: BigDecimal, processingMode: ProcessingMode = ProcessingMode.Aggregator): Result<List<Installment>, ResultError>

Retrieves available installment options for a given card and amount. This method calculates all possible installment plans based on the card's BIN, transaction amount, and processing mode.

Return

Result: On Success a list of Installment, On error ResultError

Example:

val result = coreMethods.getInstallments(
bin = bin, // CardNumberTextFieldEvent.OnBinChanged value
amount = BigDecimal("100.00"),
processingMode = ProcessingMode.Aggregator
)

when (result) {
is Result.Success -> {
val installments = result.data
// Display installment options to user
}
is Result.Error -> {
// Handle error
}
}

Parameters

bin

The first 8 digits of the card number from CardNumberTextFieldEvent.OnBinChanged value

amount

BigDecimal The total transaction amount

processingMode

ProcessingMode of the payment (Aggregator or Gateway)

See also