Interface Transaction


public interface Transaction
Transaction
Example to create an instance using the builder pattern

     Transaction transaction = Transaction.builder()
             .id("{id}")
             .timestamp("{timestamp}")
             .type(TransactionType.AUTHORIZATION)
             .amount(amountBuilder -> amountBuilder)
             .interactionId("{interactionId}")
             .state(TransactionState.INITIAL)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Transaction.

      Returns:
      id
    • getTimestamp

      @NotNull @NotNull String getTimestamp()

      Time at which the transaction took place.

      Returns:
      timestamp
    • getType

      @NotNull @NotNull TransactionType getType()
      Returns:
      type
    • getAmount

      @NotNull @Valid @NotNull @Valid Money getAmount()
      Returns:
      amount
    • getInteractionId

      @NotNull @NotNull String getInteractionId()

      Identifier used by the interface that manages the transaction (usually the PSP). If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

      Returns:
      interactionId
    • getState

      @NotNull @NotNull TransactionState getState()
      Returns:
      state
    • setId

      void setId(String id)

      Unique identifier of the Transaction.

      Parameters:
      id - value to be set
    • setTimestamp

      void setTimestamp(String timestamp)

      Time at which the transaction took place.

      Parameters:
      timestamp - value to be set
    • setType

      void setType(TransactionType type)
      set type
      Parameters:
      type - value to be set
    • setAmount

      void setAmount(Money amount)
      set amount
      Parameters:
      amount - value to be set
    • setInteractionId

      void setInteractionId(String interactionId)

      Identifier used by the interface that manages the transaction (usually the PSP). If a matching interaction was logged in the interfaceInteractions array, the corresponding interaction should be findable with this ID.

      Parameters:
      interactionId - value to be set
    • setState

      void setState(TransactionState state)
      set state
      Parameters:
      state - value to be set
    • of

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

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

      @Nullable static Transaction deepCopy(@Nullable Transaction template)
      factory method to create a deep copy of Transaction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static TransactionBuilder builder()
      builder factory method for Transaction
      Returns:
      builder
    • builder

      static TransactionBuilder builder(Transaction template)
      create builder for Transaction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withTransaction

      default <T> T withTransaction(Function<Transaction,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<Transaction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference