Fluent builder for creating and saving an InvoicePayment. Set the payment's properties by chaining calls, add one or more invoices with the amount applied to each, then call build() to create and save the InvoicePayment and link it to those invoices. A payment must be linked to exactly one of a PaymentTransaction or a PointsDebit, never both. Obtained from PaymentManager.newInvoicePaymentBuilder().

Group: Builders


Methods

build()

Returns: InvoicePayment

Creates and saves the InvoicePayment using the options set on this builder, and links it to each invoice added via addInvoice.

addInvoice(Invoice invoice, BigDecimal amount)

Returns: InvoicePaymentBuilder

Adds an invoice to be linked to the payment being built, along with the amount applied to it.

ParameterDescription
invoicethe invoice to link the payment to
amountthe amount of the payment applied to this invoice

paymentDate(Date pd)

Returns: InvoicePaymentBuilder

Sets the date the payment was made. Defaults to null if not set.

ParameterDescription
pdthe payment date

createdDate(Date pd)

Returns: InvoicePaymentBuilder

Sets the created date recorded on the payment. Defaults to the current date if not set.

ParameterDescription
pdthe created date

createdBy(Profile pd)

Returns: InvoicePaymentBuilder

Sets the profile the payment is recorded as created by. Defaults to the current user if not set.

ParameterDescription
pdthe profile the payment is created by

paymentAmount(BigDecimal pd)

Returns: InvoicePaymentBuilder

Sets the total amount of the payment.

ParameterDescription
pdthe payment amount

paymentTransaction(PaymentTransaction pd)

Returns: InvoicePaymentBuilder

Sets the payment transaction the payment is recorded against. Cannot be combined with a points debit.

ParameterDescription
pdthe payment transaction the payment is for

pointsDebit(PointsDebit pd)

Returns: InvoicePaymentBuilder

Sets the points debit the payment is recorded against. Cannot be combined with a payment transaction.

ParameterDescription
pdthe points debit the payment is for
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.