pay

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankTransfer

type BankTransfer 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, very rarely needed."`
	Notes  *i18n.String      `` /* 130-byte string literal not displayed */
	Meta   map[string]string `json:"meta,omitempty" jsonschema:"title=Meta,description=Non-structured additional data that may be useful."`
}

BankTransfer contains fields that can be used for making payments via a bank transfer or wire.

type Method

type Method struct {
	Code         MethodCode        `json:"code" jsonschema:"title=Code,description=Code for the method type that can be used."`
	BankTransfer *BankTransfer     `` /* 128-byte string literal not displayed */
	URL          *URL              `` /* 147-byte string literal not displayed */
	Notes        string            `json:"notes,omitempty" jsonschema:"title=Notes,description=Additional details related to this payment method."`
	Meta         map[string]string `json:"meta,omitempty" jsonschema:"title=Meta,description=Additional non-structure data."`
}

Method describes how payment is expected to be made and under what conditions.

type MethodCode

type MethodCode string

MethodCode defines a standard name for a given payment method.

const (
	MethodCodeCard     MethodCode = "CARD"
	MethodCodeTransfer MethodCode = "XFER"
	MethodCodeCash     MethodCode = "CASH"
	MethodCodeMandate  MethodCode = "MAN" // aka. Direct Debit
	MethodCodeURL      MethodCode = "URL" // Website from which payment can be made
)

Acceptable Methods of payment

func (MethodCode) Validate

func (c MethodCode) Validate() error

Validate ensures the method code is valid according to the GoBL list of acceptable codes.

type TermCode

type TermCode string
const (
	TermPIA   TermCode = "PIA"   // Payment in Advance
	TermPOD   TermCode = "POD"   // Payment on Delivery
	TermNet7  TermCode = "NET7"  // within 7 days
	TermNet10 TermCode = "NET10" // within 10 days
	TermNet21 TermCode = "NET21" // within 21 days
	TermNet30 TermCode = "NET30" // within 30 days
	TermNet60 TermCode = "NET60" // within 60 days
	TermNet90 TermCode = "NET90" // within 90 days
	TermEOM   TermCode = "EOM"   // End of Month
	TermOther TermCode = "OTHER"
)

type Terms

type Terms struct {
	Code  TermCode     `json:"code" jsonschema:"title=Code,description=Type of terms to be applied."`
	Notes *i18n.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.

type URL

type URL struct {
	UUID    *uuid.UUID        `json:"uuid,omitempty" jsonschema:"title=UUID"`
	Address string            `json:"addr" jsonschema:"title=Address,description=Full URL to be used for payment."`
	Notes   string            `json:"notes,omitempty" jsonschema:"title=Notes,description=Additional details which may be useful to the end-user."`
	Meta    map[string]string `json:"meta,omitempty" jsonschema:"title=Meta,description=Semi-structured additional data."`
}

URL provides the details required to make a payment online using a website

func (*URL) Validate

func (u *URL) Validate() error

Validate ensures the URL's details look correct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL