Class TransactionDraftBuilder
java.lang.Object
com.commercetools.api.models.payment.TransactionDraftBuilder
- All Implemented Interfaces:
Builder<TransactionDraft>
TransactionDraftBuilder
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()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMoney value for the Transaction.amount
(Function<MoneyBuilder, MoneyBuilder> builder) Money value for the Transaction.build()
builds TransactionDraft with checking for non-null required valuesbuilds TransactionDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields of the Transaction.Custom Fields of the Transaction.Money value for the Transaction.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.getType()
Type of the Transaction.interactionId
(String interactionId) Identifier used by the payment service that manages the Transaction.static TransactionDraftBuilder
of()
factory method for an instance of TransactionDraftBuilderstatic TransactionDraftBuilder
of
(TransactionDraft template) create builder for TransactionDraft instancestate
(TransactionState state) State of the Transaction.timestamp
(ZonedDateTime timestamp) Date and time (UTC) the Transaction took place.type
(TransactionType type) Type of the Transaction.withAmount
(Function<MoneyBuilder, Money> builder) Money value for the Transaction.Custom Fields of the Transaction.
-
Constructor Details
-
TransactionDraftBuilder
public TransactionDraftBuilder()
-
-
Method Details
-
timestamp
Date and time (UTC) the Transaction took place.
- Parameters:
timestamp
- value to be set- Returns:
- Builder
-
type
Type of the Transaction.
- Parameters:
type
- value to be set- Returns:
- Builder
-
amount
Money value for the Transaction.
- Parameters:
builder
- function to build the amount value- Returns:
- Builder
-
withAmount
Money value for the Transaction.
- Parameters:
builder
- function to build the amount value- Returns:
- Builder
-
amount
Money value for the Transaction.
- Parameters:
amount
- value to be set- Returns:
- Builder
-
interactionId
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- Returns:
- Builder
-
state
State of the Transaction.
- Parameters:
state
- value to be set- Returns:
- Builder
-
custom
public TransactionDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields of the Transaction.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public TransactionDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields of the Transaction.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields of the Transaction.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
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
Identifier used by the payment service that manages the Transaction. Can be used to correlate the Transaction to an interface interaction.
- Returns:
- interactionId
-
getState
State of the Transaction.
- Returns:
- state
-
getCustom
Custom Fields of the Transaction.
- Returns:
- custom
-
build
builds TransactionDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<TransactionDraft>
- Returns:
- TransactionDraft
-
buildUnchecked
builds TransactionDraft without checking for non-null required values- Returns:
- TransactionDraft
-
of
factory method for an instance of TransactionDraftBuilder- Returns:
- builder
-
of
create builder for TransactionDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-