Interface Transaction
public interface Transaction
Transaction
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Transaction transaction = Transaction.builder()
.id("{id}")
.timestamp("{timestamp}")
.type(TransactionType.AUTHORIZATION)
.amount(amountBuilder -> amountBuilder)
.interactionId("{interactionId}")
.state(TransactionState.INITIAL)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TransactionBuilderbuilder()builder factory method for Transactionstatic TransactionBuilderbuilder(Transaction template) create builder for Transaction instancecopyDeep()static TransactiondeepCopy(Transaction template) factory method to create a deep copy of Transaction@NotNull @Valid Money@NotNull StringgetId()Unique identifier of the Transaction.@NotNull StringIdentifier used by the interface that manages the transaction (usually the PSP).@NotNull TransactionStategetState()@NotNull StringTime at which the transaction took place.@NotNull TransactionTypegetType()static Transactionof()factory methodstatic Transactionof(Transaction template) factory method to create a shallow copy Transactionvoidset amountvoidUnique identifier of the Transaction.voidsetInteractionId(String interactionId) Identifier used by the interface that manages the transaction (usually the PSP).voidsetState(TransactionState state) set statevoidsetTimestamp(String timestamp) Time at which the transaction took place.voidsetType(TransactionType type) set typestatic com.fasterxml.jackson.core.type.TypeReference<Transaction>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithTransaction(Function<Transaction, T> helper) accessor map function
-
Method Details
-
getId
Unique identifier of the Transaction.
- Returns:
- id
-
getTimestamp
Time at which the transaction took place.
- Returns:
- timestamp
-
getType
- Returns:
- type
-
getAmount
- Returns:
- amount
-
getInteractionId
Identifier used by the interface that manages the transaction (usually the PSP). If a matching interaction was logged in the
interfaceInteractionsarray, the corresponding interaction should be findable with this ID.- Returns:
- interactionId
-
getState
- Returns:
- state
-
setId
Unique identifier of the Transaction.
- Parameters:
id- value to be set
-
setTimestamp
Time at which the transaction took place.
- Parameters:
timestamp- value to be set
-
setType
set type- Parameters:
type- value to be set
-
setAmount
set amount- Parameters:
amount- value to be set
-
setInteractionId
Identifier used by the interface that manages the transaction (usually the PSP). If a matching interaction was logged in the
interfaceInteractionsarray, the corresponding interaction should be findable with this ID.- Parameters:
interactionId- value to be set
-
setState
set state- Parameters:
state- value to be set
-
of
factory method- Returns:
- instance of Transaction
-
of
factory method to create a shallow copy Transaction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
Transaction copyDeep() -
deepCopy
factory method to create a deep copy of Transaction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Transaction- Returns:
- builder
-
builder
create builder for Transaction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withTransaction
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-