Class PaymentDraftBuilder

java.lang.Object
com.commercetools.api.models.payment.PaymentDraftBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<PaymentDraft>

public class PaymentDraftBuilder extends Object implements io.vrap.rmf.base.client.Builder<PaymentDraft>
PaymentDraftBuilder
Example to create an instance using the builder pattern

     PaymentDraft paymentDraft = PaymentDraft.builder()
             .amountPlanned(amountPlannedBuilder -> amountPlannedBuilder)
             .build()
 
  • Constructor Details

    • PaymentDraftBuilder

      public PaymentDraftBuilder()
  • Method Details

    • customer

      Reference to a Customer associated with the Payment.

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

      Reference to a Customer associated with the Payment.

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

      Reference to a Customer associated with the Payment.

      Parameters:
      customer - value to be set
      Returns:
      Builder
    • anonymousId

      public PaymentDraftBuilder anonymousId(@Nullable String anonymousId)

      Anonymous session associated with the Payment.

      Parameters:
      anonymousId - value to be set
      Returns:
      Builder
    • interfaceId

      public PaymentDraftBuilder interfaceId(@Nullable String interfaceId)

      Identifier used by the payment service that processes the Payment (for example, a PSP). The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique. Once set, it cannot be changed.

      Parameters:
      interfaceId - value to be set
      Returns:
      Builder
    • amountPlanned

      public PaymentDraftBuilder amountPlanned(Function<MoneyBuilder,MoneyBuilder> builder)

      Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.

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

      public PaymentDraftBuilder withAmountPlanned(Function<MoneyBuilder,Money> builder)

      Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.

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

      public PaymentDraftBuilder amountPlanned(Money amountPlanned)

      Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.

      Parameters:
      amountPlanned - value to be set
      Returns:
      Builder
    • paymentMethodInfo

      Information regarding the payment interface (for example, a PSP), and the specific payment method used.

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

      Information regarding the payment interface (for example, a PSP), and the specific payment method used.

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

      public PaymentDraftBuilder paymentMethodInfo(@Nullable PaymentMethodInfo paymentMethodInfo)

      Information regarding the payment interface (for example, a PSP), and the specific payment method used.

      Parameters:
      paymentMethodInfo - value to be set
      Returns:
      Builder
    • paymentStatus

      Current status of the Payment.

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

      Current status of the Payment.

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

      public PaymentDraftBuilder paymentStatus(@Nullable PaymentStatusDraft paymentStatus)

      Current status of the Payment.

      Parameters:
      paymentStatus - value to be set
      Returns:
      Builder
    • transactions

      public PaymentDraftBuilder transactions(@Nullable TransactionDraft... transactions)

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

      Parameters:
      transactions - value to be set
      Returns:
      Builder
    • transactions

      public PaymentDraftBuilder transactions(@Nullable List<TransactionDraft> transactions)

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

      Parameters:
      transactions - value to be set
      Returns:
      Builder
    • plusTransactions

      public PaymentDraftBuilder plusTransactions(@Nullable TransactionDraft... transactions)

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

      Parameters:
      transactions - value to be set
      Returns:
      Builder
    • plusTransactions

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

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

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

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

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

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

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

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

      public PaymentDraftBuilder interfaceInteractions(@Nullable CustomFieldsDraft... interfaceInteractions)

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

      Parameters:
      interfaceInteractions - value to be set
      Returns:
      Builder
    • interfaceInteractions

      public PaymentDraftBuilder interfaceInteractions(@Nullable List<CustomFieldsDraft> interfaceInteractions)

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

      Parameters:
      interfaceInteractions - value to be set
      Returns:
      Builder
    • plusInterfaceInteractions

      public PaymentDraftBuilder plusInterfaceInteractions(@Nullable CustomFieldsDraft... interfaceInteractions)

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

      Parameters:
      interfaceInteractions - value to be set
      Returns:
      Builder
    • plusInterfaceInteractions

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

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

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

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

      public PaymentDraftBuilder addInterfaceInteractions(Function<CustomFieldsDraftBuilder,CustomFieldsDraft> builder)

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

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

      public PaymentDraftBuilder setInterfaceInteractions(Function<CustomFieldsDraftBuilder,CustomFieldsDraft> builder)

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

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

      Custom Fields for the Payment.

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

      Custom Fields for the Payment.

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

      Custom Fields for the Payment.

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

      User-defined unique identifier for the Payment.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • getCustomer

      @Nullable public CustomerResourceIdentifier getCustomer()

      Reference to a Customer associated with the Payment.

      Returns:
      customer
    • getAnonymousId

      @Nullable public String getAnonymousId()

      Anonymous session associated with the Payment.

      Returns:
      anonymousId
    • getInterfaceId

      @Nullable public String getInterfaceId()

      Identifier used by the payment service that processes the Payment (for example, a PSP). The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique. Once set, it cannot be changed.

      Returns:
      interfaceId
    • getAmountPlanned

      public Money getAmountPlanned()

      Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.

      Returns:
      amountPlanned
    • getPaymentMethodInfo

      @Nullable public PaymentMethodInfo getPaymentMethodInfo()

      Information regarding the payment interface (for example, a PSP), and the specific payment method used.

      Returns:
      paymentMethodInfo
    • getPaymentStatus

      @Nullable public PaymentStatusDraft getPaymentStatus()

      Current status of the Payment.

      Returns:
      paymentStatus
    • getTransactions

      @Nullable public List<TransactionDraft> getTransactions()

      Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.

      Returns:
      transactions
    • getInterfaceInteractions

      @Nullable public List<CustomFieldsDraft> getInterfaceInteractions()

      Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.

      Returns:
      interfaceInteractions
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Payment.

      Returns:
      custom
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the Payment.

      Returns:
      key
    • build

      public PaymentDraft build()
      builds PaymentDraft with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<PaymentDraft>
      Returns:
      PaymentDraft
    • buildUnchecked

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

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

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