AbstractBuilder

Base builder shared by every transaction-type-specific builder below (PurchaseBuilder, PurchaseWithCashbackBuilder, LoadBuilder, FundingBuilder, ForcedAcceptanceBuilder, CashAdvanceBuilder, CreditBuilder). Each subclass fixes TransactionRequest.type to the one it was created for and only exposes the fields that apply to that type - for example only PurchaseWithCashbackBuilder exposes cashbackAmount(...), since that field is meaningless for every other TransactionType. There is intentionally no generic builder that lets a caller pick an arbitrary type and then guess which other fields apply to it.

Inheritors

Functions

Link copied to clipboard
fun amount(amount: Amount): T

Amount to charge.

fun amount(value: Long, fractionDigits: Int, currency: Int): T

amount taking the ISO-4217 numeric currency code - the officially supported form, for example amount(1050, 2, 756) for CHF 10.50 - instead of the alphabetic code.

fun amount(value: Long, fractionDigits: Int, currency: String): T

Amount to charge, expressed with fractionDigits fraction digits instead of currency's own default, for example amount(1050, 2, "CHF") for CHF 10.50 - useful when the value is only known at a different (or unknown) scale, for example digit-by-digit from a UI text field typed by a cashier, without needing java.math.BigDecimal. Rescaled to currency's actual minor units, rounding half up if fractionDigits is more precise than the currency supports.

Link copied to clipboard
Link copied to clipboard
fun manualCardEntry(pan: String, expiryDate: String, cvc2: String? = null): T

Sets pan/expiryDate/cvc2 together for manual PAN key entry ("MPKE") - see TransactionRequest.pan for field meaning. cvc2 is optional.

Link copied to clipboard
fun transactionId(transactionId: String): T

Sets TransactionRequest.transactionId. Optional - defaults to a random UUID if never called. Set explicitly to control it, for example to persist it before starting the transaction (see "Payment recovery" in the README).