Interface MyTransactionDraft

All Superinterfaces:
CustomizableDraft<MyTransactionDraft>, Draft<MyTransactionDraft>

public interface MyTransactionDraft extends CustomizableDraft<MyTransactionDraft>, Draft<MyTransactionDraft>
MyTransactionDraft
Example to create an instance using the builder pattern

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

    • getTimestamp

      ZonedDateTime getTimestamp()

      Date and time (UTC) the Transaction took place.

      Returns:
      timestamp
    • getType

      @NotNull @NotNull TransactionType getType()

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

      Returns:
      type
    • getAmount

      @NotNull @Valid @NotNull @Valid Money 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
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields of the Transaction.

      Specified by:
      getCustom in interface CustomizableDraft<MyTransactionDraft>
      Returns:
      custom
    • setTimestamp

      void setTimestamp(ZonedDateTime timestamp)

      Date and time (UTC) the Transaction took place.

      Parameters:
      timestamp - value to be set
    • setType

      void setType(TransactionType type)

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

      Parameters:
      type - value to be set
    • setAmount

      void setAmount(Money amount)

      Money value for the Transaction.

      Parameters:
      amount - value to be set
    • setInteractionId

      void setInteractionId(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
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields of the Transaction.

      Specified by:
      setCustom in interface CustomizableDraft<MyTransactionDraft>
      Parameters:
      custom - value to be set
    • of

      static MyTransactionDraft of()
      factory method
      Returns:
      instance of MyTransactionDraft
    • of

      static MyTransactionDraft of(MyTransactionDraft template)
      factory method to create a shallow copy MyTransactionDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of MyTransactionDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static MyTransactionDraftBuilder builder()
      builder factory method for MyTransactionDraft
      Returns:
      builder
    • builder

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

      default <T> T withMyTransactionDraft(Function<MyTransactionDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<MyTransactionDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference