Class MyTransactionDraftBuilder

java.lang.Object
com.commercetools.api.models.me.MyTransactionDraftBuilder
All Implemented Interfaces:
Builder<MyTransactionDraft>

public class MyTransactionDraftBuilder extends Object implements Builder<MyTransactionDraft>
MyTransactionDraftBuilder
Example to create an instance using the builder pattern

     MyTransactionDraft myTransactionDraft = MyTransactionDraft.builder()
             .type(TransactionType.AUTHORIZATION)
             .amount(amountBuilder -> amountBuilder)
             .build()
 
  • Constructor Details

    • MyTransactionDraftBuilder

      public MyTransactionDraftBuilder()
  • Method Details

    • timestamp

      public MyTransactionDraftBuilder timestamp(@Nullable ZonedDateTime timestamp)

      Date and time (UTC) the Transaction took place.

      Parameters:
      timestamp - value to be set
      Returns:
      Builder
    • type

      Type of the Transaction. Only Authorization or Charge 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

      public MyTransactionDraftBuilder withAmount(Function<MoneyBuilder,Money> builder)

      Money value for the Transaction.

      Parameters:
      builder - function to build the amount value
      Returns:
      Builder
    • amount

      public MyTransactionDraftBuilder amount(Money amount)

      Money value for the Transaction.

      Parameters:
      amount - value to be set
      Returns:
      Builder
    • interactionId

      public MyTransactionDraftBuilder interactionId(@Nullable String 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

      Custom Fields of the Transaction.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields of the Transaction.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      public MyTransactionDraftBuilder custom(@Nullable CustomFieldsDraft custom)

      Custom Fields of the Transaction.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getTimestamp

      @Nullable public ZonedDateTime getTimestamp()

      Date and time (UTC) the Transaction took place.

      Returns:
      timestamp
    • getType

      public TransactionType getType()

      Type of the Transaction. Only Authorization or Charge is allowed.

      Returns:
      type
    • getAmount

      public Money getAmount()

      Money value for the Transaction.

      Returns:
      amount
    • getInteractionId

      @Nullable public 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
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields of the Transaction.

      Returns:
      custom
    • build

      public MyTransactionDraft build()
      builds MyTransactionDraft with checking for non-null required values
      Specified by:
      build in interface Builder<MyTransactionDraft>
      Returns:
      MyTransactionDraft
    • buildUnchecked

      public MyTransactionDraft buildUnchecked()
      builds MyTransactionDraft without checking for non-null required values
      Returns:
      MyTransactionDraft
    • of

      public static MyTransactionDraftBuilder of()
      factory method for an instance of MyTransactionDraftBuilder
      Returns:
      builder
    • of

      public static MyTransactionDraftBuilder of(MyTransactionDraft template)
      create builder for MyTransactionDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder