Interface Transaction
- All Superinterfaces:
Customizable<Transaction>
Represents a financial transaction typically created as a result of a notification from the payment service.
Example to create an instance using the builder pattern
Transaction transaction = Transaction.builder()
.id("{id}")
.type(TransactionType.AUTHORIZATION)
.amount(amountBuilder -> amountBuilder)
.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 CentPrecisionMoneyMoney value of the Transaction.@Valid CustomFieldsCustom Fields defined for the Transaction.@NotNull StringgetId()Unique identifier of the Transaction.Identifier used by the interface that manages the Transaction (usually the PSP).Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.@NotNull TransactionStategetState()State of the Transaction.Date and time (UTC) the Transaction took place.@NotNull TransactionTypegetType()Type of the Transaction.static Transactionof()factory methodstatic Transactionof(Transaction template) factory method to create a shallow copy TransactionvoidsetAmount(CentPrecisionMoney amount) Money value of the Transaction.voidsetCustom(CustomFields custom) Custom Fields defined for the Transaction.voidUnique identifier of the Transaction.voidsetInteractionId(String interactionId) Identifier used by the interface that manages the Transaction (usually the PSP).voidsetInterfaceId(String interfaceId) Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.voidsetState(TransactionState state) State of the Transaction.voidsetTimestamp(ZonedDateTime timestamp) Date and time (UTC) the Transaction took place.voidsetType(TransactionType type) Type of the Transaction.static com.fasterxml.jackson.core.type.TypeReference<Transaction>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithTransaction(Function<Transaction, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
-
Method Details
-
getId
Unique identifier of the Transaction.
- Returns:
- id
-
getTimestamp
ZonedDateTime getTimestamp()Date and time (UTC) the Transaction took place.
- Returns:
- timestamp
-
getType
Type of the Transaction. For example,
Authorization.- Returns:
- type
-
getAmount
Money value of the Transaction.
- Returns:
- amount
-
getInteractionId
String 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 can be found with this ID.- Returns:
- interactionId
-
getState
State of the Transaction.
- Returns:
- state
-
getCustom
Custom Fields defined for the Transaction.
- Specified by:
getCustomin interfaceCustomizable<Transaction>- Returns:
- custom
-
getInterfaceId
String getInterfaceId()Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.
- Returns:
- interfaceId
-
setId
Unique identifier of the Transaction.
- Parameters:
id- value to be set
-
setTimestamp
Date and time (UTC) the Transaction took place.
- Parameters:
timestamp- value to be set
-
setType
Type of the Transaction. For example,
Authorization.- Parameters:
type- value to be set
-
setAmount
Money value of the Transaction.
- 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 can be found with this ID.- Parameters:
interactionId- value to be set
-
setState
State of the Transaction.
- Parameters:
state- value to be set
-
setCustom
Custom Fields defined for the Transaction.
- Specified by:
setCustomin interfaceCustomizable<Transaction>- Parameters:
custom- value to be set
-
setInterfaceId
Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.
- Parameters:
interfaceId- 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
-