Class MyTransactionDraftBuilder
- All Implemented Interfaces:
Builder<MyTransactionDraft>
Example to create an instance using the builder pattern
MyTransactionDraft myTransactionDraft = MyTransactionDraft.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 MyTransactionDraft with checking for non-null required valuesbuilds MyTransactionDraft 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.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 MyTransactionDraftBuilder
of()
factory method for an instance of MyTransactionDraftBuilderstatic MyTransactionDraftBuilder
of
(MyTransactionDraft template) create builder for MyTransactionDraft instancetimestamp
(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
-
MyTransactionDraftBuilder
public MyTransactionDraftBuilder()
-
-
Method Details
-
timestamp
Date and time (UTC) the Transaction took place.
- Parameters:
timestamp
- value to be set- Returns:
- Builder
-
type
Type of the Transaction. Only
Authorization
orCharge
is allowed.- 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
-
custom
public MyTransactionDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields of the Transaction.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public MyTransactionDraftBuilder 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. Only
Authorization
orCharge
is allowed.- 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
-
getCustom
Custom Fields of the Transaction.
- Returns:
- custom
-
build
builds MyTransactionDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<MyTransactionDraft>
- Returns:
- MyTransactionDraft
-
buildUnchecked
builds MyTransactionDraft without checking for non-null required values- Returns:
- MyTransactionDraft
-
of
factory method for an instance of MyTransactionDraftBuilder- Returns:
- builder
-
of
create builder for MyTransactionDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-