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. The result includes detailed information about each installment option including rates and fees.
Return
Result
Example:
val result = coreMethods.getInstallments(
bin = "411111",
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
}
}
Content copied to clipboard
Parameters
bin
The first 6 digits of the card number (BIN)
amount
The total transaction amount
processingMode
The payment processing mode (Aggregator or Gateway)