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 TransactionBuilder
builder()
builder factory method for Transactionstatic TransactionBuilder
builder
(Transaction template) create builder for Transaction instancestatic Transaction
deepCopy
(Transaction template) factory method to create a deep copy of Transaction@NotNull @Valid Money
@NotNull String
getId()
Unique identifier of the Transaction.@NotNull String
Identifier used by the interface that manages the transaction (usually the PSP).@NotNull TransactionState
getState()
@NotNull String
Time at which the transaction took place.@NotNull TransactionType
getType()
static Transaction
of()
factory methodstatic Transaction
of
(Transaction template) factory method to create a shallow copy Transactionvoid
set amountvoid
Unique identifier of the Transaction.void
setInteractionId
(String interactionId) Identifier used by the interface that manages the transaction (usually the PSP).void
setState
(TransactionState state) set statevoid
setTimestamp
(String timestamp) Time at which the transaction took place.void
setType
(TransactionType type) set typestatic com.fasterxml.jackson.core.type.TypeReference<Transaction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withTransaction
(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
interfaceInteractions
array, 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
interfaceInteractions
array, 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
-
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
-