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
Constructors -
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 for the Transaction.Custom Fields for the Transaction.Money value for the Transaction.Custom Fields for the Transaction.Identifier used by the payment service that manages the Transaction.Identifier used by the payment service that processes the Payment (for example, a PSP) in the current 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.interfaceId(String interfaceId) Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.static MyTransactionDraftBuilderof()factory method for an instance of MyTransactionDraftBuilderstatic MyTransactionDraftBuilderof(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 for 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
AuthorizationorChargeis 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 for the Transaction.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
withCustom
public MyTransactionDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the Transaction.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Transaction.
- Parameters:
custom- value to be set- Returns:
- Builder
-
interfaceId
Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.
- Parameters:
interfaceId- value to be set- Returns:
- Builder
-
getTimestamp
Date and time (UTC) the Transaction took place.
- Returns:
- timestamp
-
getType
Type of the Transaction. Only
AuthorizationorChargeis 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 for the Transaction.
- Returns:
- custom
-
getInterfaceId
Identifier used by the payment service that processes the Payment (for example, a PSP) in the current transaction.
- Returns:
- interfaceId
-
build
builds MyTransactionDraft with checking for non-null required values- Specified by:
buildin 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
-