Interface TransactionDraft
- All Superinterfaces:
CustomizableDraft<TransactionDraft>
,Draft<TransactionDraft>
public interface TransactionDraft
extends CustomizableDraft<TransactionDraft>, Draft<TransactionDraft>
TransactionDraft
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
TransactionDraft transactionDraft = TransactionDraft.builder()
.type(TransactionType.AUTHORIZATION)
.amount(amountBuilder -> amountBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic TransactionDraftBuilder
builder()
builder factory method for TransactionDraftstatic TransactionDraftBuilder
builder
(TransactionDraft template) create builder for TransactionDraft instancestatic TransactionDraft
deepCopy
(TransactionDraft template) factory method to create a deep copy of TransactionDraft@NotNull @Valid Money
Money value for the Transaction.@Valid CustomFieldsDraft
Custom Fields of the Transaction.Identifier used by the payment service that manages the Transaction.getState()
State of the Transaction.Date and time (UTC) the Transaction took place.@NotNull TransactionType
getType()
Type of the Transaction.static TransactionDraft
of()
factory methodstatic TransactionDraft
of
(TransactionDraft template) factory method to create a shallow copy TransactionDraftvoid
Money value for the Transaction.void
setCustom
(CustomFieldsDraft custom) Custom Fields of the Transaction.void
setInteractionId
(String interactionId) Identifier used by the payment service that manages the Transaction.void
setState
(TransactionState state) State of the Transaction.void
setTimestamp
(ZonedDateTime timestamp) Date and time (UTC) the Transaction took place.void
setType
(TransactionType type) Type of the Transaction.static com.fasterxml.jackson.core.type.TypeReference<TransactionDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withTransactionDraft
(Function<TransactionDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getTimestamp
ZonedDateTime getTimestamp()Date and time (UTC) the Transaction took place.
- Returns:
- timestamp
-
getType
Type of the Transaction.
- Returns:
- type
-
getAmount
Money value for the Transaction.
- Returns:
- amount
-
getInteractionId
String getInteractionId()Identifier used by the payment service that manages the Transaction. Can be used to correlate the Transaction to an interface interaction.
- Returns:
- interactionId
-
getState
TransactionState getState()State of the Transaction.
- Returns:
- state
-
getCustom
Custom Fields of the Transaction.
- Specified by:
getCustom
in interfaceCustomizableDraft<TransactionDraft>
- Returns:
- custom
-
setTimestamp
Date and time (UTC) the Transaction took place.
- Parameters:
timestamp
- value to be set
-
setType
Type of the Transaction.
- Parameters:
type
- value to be set
-
setAmount
Money value for the Transaction.
- Parameters:
amount
- value to be set
-
setInteractionId
Identifier used by the payment service that manages the Transaction. Can be used to correlate the Transaction to an interface interaction.
- Parameters:
interactionId
- value to be set
-
setState
State of the Transaction.
- Parameters:
state
- value to be set
-
setCustom
Custom Fields of the Transaction.
- Specified by:
setCustom
in interfaceCustomizableDraft<TransactionDraft>
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of TransactionDraft
-
of
factory method to create a shallow copy TransactionDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of TransactionDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for TransactionDraft- Returns:
- builder
-
builder
create builder for TransactionDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withTransactionDraft
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
-