Transaction Request
Payment request passed to Terminal.startTransaction or Terminal.startTransactionAsync. Use the factory for the payment type, such as purchase or purchaseWithCashback. The constructor enforces the same rules as the builders. Reversals use ReversalRequest.
Constructors
Types
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.
Builds a TransactionType.CASH_ADVANCE request (PostFinance cashback operation).
Builds a TransactionType.CREDIT request (refund).
Builds a TransactionType.PURCHASE_FORCED_ACCEPTANCE request (emergency-mode payment).
Builds a TransactionType.FUNDING request (prepaid card recharging).
Builds a TransactionType.LOAD request (loading prepaid cards).
Builds a standard TransactionType.PURCHASE request - the default for every existing call site.
Builds a TransactionType.PURCHASE_WITH_CASHBACK request. cashbackAmount(...) must be called - unlike amount, there is no reasonable default for it, and the whole point of this transaction type is to carry one.
Properties
Cashback included in amount. Required for TransactionType.PURCHASE_WITH_CASHBACK, null for every other payment type. Must use the total's currency and not exceed the total.
Card PAN for manual PAN key entry ("MPKE", EP2 <Application Primary Account Number (PAN)>), typed in by the cashier instead of read from the physical card. null for the normal case where the terminal reads the card. Required together with expiryDate.
Tags which "sale" this transaction belongs to (1..n transactions can share a salesId, e.g. split tender) - only meaningful for TransactionType.PURCHASE, TransactionType.CASH_ADVANCE or TransactionType.FUNDING. Use a POS-generated UUID.
Application-generated id used for recovery via Terminal.fetchTransactionStatus/Terminal.resume. Defaults to a random UUID; set explicitly to control it, for example to persist it before starting the transaction (see "Payment recovery" in the README).
Kind of transaction to start. Defaults to TransactionType.PURCHASE.