InvoiceItem to the invoice with fluent access for specifying the invoice item details. Required.ClassInvoice
InvoiceBuilder
Facilitates configuring and building an
Invoice instance.Technology
- Quantum
Pay Client
Declaration
class InvoiceBuilderTopics
Initializers
Instance Methods
func addItem (item: InvoiceItem ) -> InvoiceBuilder Add a new
func addItem (itemBuilder : (_ x: InvoiceItemBuilder ) -> InvoiceItemBuilder ) -> InvoiceBuilder Add a new
InvoiceItem to the invoice with fluent access for specifying the invoice item details. Required.func addItem (productCode : String, description: String, price: Decimal) -> InvoiceBuilder Add a new
InvoiceItem to the invoice with the minimum required details, specifying the product code or SKU, the description and the total price for the item. The resulting invoice item will have a quantity of 1.func build() throws -> InvoiceBuilds the
Invoice instance with the provided values.func calculateTotals (calculateNet : Bool, calculateDiscount : Bool, calculateTax : Bool, calculateGross : Bool) -> InvoiceBuilder Calculates the totals on the invoice by summarizing the invoice item totals. Optionally control whether the net, discount, tax and gross totals should be calculated. The net total will be a summary of the net totals of invoice items. The discount total will be a summary of the discount totals of invoice items. The tax total will be a summary of the tax totals of invoice items. The gross total will add together the net total and the tax total, subtracting the discount total and adding the tip amount.
func companyName (companyName : String) -> InvoiceBuilder Specify the full Company Name that appears on the invoice. Required.
func purchaseOrderReference (reference: String) -> InvoiceBuilder Specify a Purchase Order reference code for this invoice. Optional.
func setDiscountTotal (discountTotal : Decimal) -> InvoiceBuilder Sets the total amount of discount on the invoice in the currency of the
Transaction.func setGrossTotal (grossTotal : Decimal) -> InvoiceBuilder Sets the gross total amount on the invoice in the currency of the
Transaction.func setNetTotal (netTotal : Decimal) -> InvoiceBuilder Sets the net total amount of the invoice in the currency of the
Transaction.func setTaxTotal (taxTotal : Decimal) -> InvoiceBuilder Sets the total amount of tax on the invoice in the currency of the
Transaction.func setTipTotal (tipTotal : Decimal) -> InvoiceBuilder Sets the tip amount on the invoice in the currency of the
Transaction.