Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advance ¶ added in v0.2.0
type Advance struct {
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID,description=Unique identifier for this advance."`
Date *org.Date `json:"date,omitempty" jsonschema:"title=Date,description=When the advance was made."`
Code string `json:"code,omitempty" jsonschema:"title=Code,description=Reference for the advance."`
Description string `json:"desc" jsonschema:"title=Description,description=Details about the advance."`
Amount num.Amount `json:"amount" jsonschema:"title=Amount,description=How much was paid."`
Currency currency.Code `json:"currency,omitempty" jsonschema:"title=Currency,description=If different from the parent document's base currency."`
}
Advance represents a single payment that has been made already, such as a deposit on an intent to purchase, or as credit from a previous invoice which was later corrected or cancelled.
type Card ¶ added in v0.2.0
type Card struct {
Last4 string `json:"last4" jsonschema:"title=Last 4,description=Last 4 digits of the card's Primary Account Number (PAN)."`
Holder string `json:"holder" jsonschema:"title=Holder Name,description=Name of the person whom the card belongs to."`
}
Card contains simplified card holder data as a reference for the customer.
type CreditTransfer ¶ added in v0.2.0
type CreditTransfer struct {
IBAN string `json:"iban,omitempty" jsonschema:"title=IBAN,description=International Bank Account Number"`
BIC string `json:"bic,omitempty" jsonschema:"title=BIC,description=Bank Identifier Code used for international transfers."`
Number string `json:"number,omitempty" jsonschema:"title=Number,description=Account number, if IBAN not available."`
Name string `json:"name,omitempty" jsonschema:"title=Name,description=Name of the bank."`
Branch *org.Address `json:"branch,omitempty" jsonschema:"title=Branch,description=Bank office branch address, not normally required."`
}
CreditTransfer contains fields that can be used for making payments via a bank transfer or wire.
type DirectDebit ¶ added in v0.2.0
type DirectDebit struct {
Ref string `` /* 143-byte string literal not displayed */
Creditor string `` /* 151-byte string literal not displayed */
Account string `json:"account,omitempty" jsonschema:"title=Account,description=Account identifier to be debited by the direct debit."`
}
DirectDebit defines the data that will be used to make the direct debit.
type DueDate ¶ added in v0.2.0
type DueDate struct {
Date *org.Date `json:"date" jsonschema:"title=Date,description=When the payment is due."`
Notes string `json:"notes,omitempty" jsonschema:"title=Notes,description=Other details to take into account for the due date."`
Amount num.Amount `json:"amount" jsonschema:"title=Amount,description=How much needs to be paid by the date."`
Percent *num.Percentage `json:"percent,omitempty" jsonschema:"title=Percent,description=Percentage of the total that should be paid by the date."`
Currency currency.Code `json:"currency,omitempty" jsonschema:"title=Currency,description=If different from the parent document's base currency."`
}
DueDate contains an amount that should be paid by the given date.
type Instructions ¶ added in v0.2.0
type Instructions struct {
Code MethodCode `json:"code" jsonschema:"title=Code,description=How payment is expected or has been arranged to be collected."`
Detail string `json:"detail,omitempty" jsonschema:"title=Detail,description=Optional text description of the payment method."`
Ref string `` /* 135-byte string literal not displayed */
CreditTransfer []*CreditTransfer `` /* 133-byte string literal not displayed */
Card *Card `` /* 126-byte string literal not displayed */
DirectDebit *DirectDebit `` /* 170-byte string literal not displayed */
Online []*Online `json:"online,omitempty" jsonschema:"title=Online,description=Array of online payment options."`
Notes string `` /* 129-byte string literal not displayed */
Meta map[string]string `json:"meta,omitempty" jsonschema:"title=Meta,description=Non-structured additional data that may be useful."`
}
Instructions holds a set of instructions that determine how the payment has or should be made. A single "code" exists in which the preferred payment method should be provided. All other details serve as a reference.
type MethodCode ¶
type MethodCode string
MethodCode defines a standard set of names for payment means.
const ( MethodCodeAny MethodCode = "any" // Use any method available. MethodCodeCard MethodCode = "card" MethodCodeCreditTransfer MethodCode = "credit_transfer" MethodCodeCash MethodCode = "cash" MethodCodeDirectDebit MethodCode = "direct_debit" // aka. Mandate MethodCodeOnline MethodCode = "online" // Website from which payment can be made )
Standard payment method codes. This is a heavily reduced list of practical codes which can be linked to UNTDID 4461 counterparts. If you require more payment method options, please send your pull requests.
func (MethodCode) UNTDID4461 ¶ added in v0.2.0
func (c MethodCode) UNTDID4461() string
UNTDID4461 provides the standard UNTDID 4461 code for the payment method.
type Online ¶ added in v0.2.0
type Online struct {
Name string `json:"name,omitempty" jsonschema:"title=Name,description=Descriptive name given to the online provider."`
Address string `json:"addr" jsonschema:"title=Address,description=Full URL to be used for payment."`
}
Online provides the details required to make a payment online using a website
type TermCode ¶
type TermCode string
TermCode is used to define a code that identifies the payment terms.
const ( TermNA TermCode = "na" // None defined TermEndOfMonth TermCode = "end_of_month" // End of Month TermDueDate TermCode = "due_date" // Due on a specific date TermDeferred TermCode = "deferred" // Deferred until after the due dates TermProximo TermCode = "proximo" // Month after the present TermInstant TermCode = "instant" // on receipt of invoice TermElective TermCode = "elective" // chosen by buyer TermPending TermCode = "pending" // Seller to advise buyer in separate transaction TermAdvance TermCode = "advance" // Payment made in advance TermDelivery TermCode = "delivery" // Payment on Delivery )
Pre-defined Payment Terms based on UNTDID 4279
type Terms ¶
type Terms struct {
Code TermCode `json:"code" jsonschema:"title=Code,description=Type of terms to be applied."`
Detail string `json:"detail,omitempty" jsonschema:"title=Detail,description=Text detail of the chosen payment terms."`
DueDates []*DueDate `json:"due_dates,omitempty" jsonschema:"title=Due Dates,description=Set of dates for agreed payments."`
Notes string `json:"notes,omitempty" jsonschema:"title=Notes,description=Description of the conditions for payment."`
}
Terms defines when we expect the customer to pay, or have paid, for the contents of the document.
func (*Terms) CalculateDues ¶ added in v0.2.0
CalculateDues goes through each DueDate. If it has a percentage value set, it'll be used to calculate the amount.