public abstract class TransactionRequest
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
|
TransactionRequest()
Constructor.
|
protected |
TransactionRequest(int currencyId,
long totalAmount)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrencyId() |
java.lang.Enum<PaymentFeatures>[] |
getDisabledFeatures() |
java.lang.String[] |
getLoyaltyApplications() |
java.lang.String |
getPaymentMethod() |
java.lang.String |
getSaleId() |
long |
getTotalAmount() |
void |
setCurrencyId(int value) |
void |
setDisabledFeatures(java.lang.Enum<PaymentFeatures>[] features) |
void |
setLoyaltyApplications(java.lang.String[] applications) |
void |
setPaymentMethod(java.lang.String paymentMethod)
Specifies that a specific payment method should be used in this transaction.
|
void |
setSaleId(java.lang.String value) |
void |
setTotalAmount(long value) |
public TransactionRequest()
protected TransactionRequest(int currencyId, long totalAmount)
currencyId
- The preferred currency of the transaction.totalAmount
- The total amount of the transaction, in the small unit of the currency.public final int getCurrencyId()
public final void setCurrencyId(int value)
value
- The preferred currency of the transaction. This has to match the currency
that is enabled in the payment application configuration.
The currency is specified using ISO 4217 3-digit codes. Some examples are:
public final java.lang.Enum<PaymentFeatures>[] getDisabledFeatures()
public final void setDisabledFeatures(java.lang.Enum<PaymentFeatures>[] features)
features
- Zero or more features that should be disabled for the transaction.
Note! Some features rely on the terminal being configured for them, so they might not be enabled just being they are not disabled here.
public final long getTotalAmount()
public final void setTotalAmount(long value)
value
- The total amount of the transaction. This amount should include all other
amounts, like cashback, or tipping.
Note! The amount must be specified in the "small unit" of the currency. For example, for EUR the amount must be specified in cents, for SEK it must be specified in ören, and so on. So an amount of 12.50 EUR translates into 1250 cents.
public final java.lang.String getSaleId()
public final void setSaleId(java.lang.String value)
value
- The sale id of the transaction. The sale id is something the POS application
can use to correlate the transaction with its own transaction data. The
payment application does not use this value for anything and will just
repeat the value in the transaction response.TransactionResponse.getSaleId()
public final java.lang.String[] getLoyaltyApplications()
public final void setLoyaltyApplications(java.lang.String[] applications)
applications
- A list of names of loyalty applications that should be accepted
during the transaction.public java.lang.String getPaymentMethod()
public void setPaymentMethod(java.lang.String paymentMethod)
If this is not set, then the terminal will let the user choose which payment method to use, based on which methods are available.
If the requested method is not available on the terminal, the transaction will fail.
To check which payment method was used in a transaction, get the payment details from
TransactionResponse.getPaymentDetails()
.
paymentMethod
- The name of the requested payment method, e.g. "swish", or "vipps".