schema

package
v0.0.0-...-3b5fe6f Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSameParty

func IsSameParty(partyA *Party, partyB *Party) bool

IsSameParty checks equality of party key properties

func Validate

func Validate(payment *Payment) []error

Validate a payment resource

func ValidateID

func ValidateID(ID string) error

ValidateID of a payment

Types

type Charges

type Charges struct {
	ID                      uint     `gorm:"primary_key" json:"-"`
	BearerCode              string   `json:"bearer_code"`
	ReceiverChargesAmount   string   `json:"receiver_charges_amount"`
	ReceiverChargesCurrency string   `json:"receiver_charges_currency"`
	SenderCharges           []*Money `json:"sender_charges"`
	PaymentAttributesID     uint     `gorm:"unique;not null" json:"-"`
}

Charges resource

func ValidCharges

func ValidCharges() Charges

ValidCharges an example of a valid currency exchange

type CurrencyExchange

type CurrencyExchange struct {
	ID                  uint   `gorm:"primary_key" json:"-"`
	ContractReference   string `json:"contract_reference"`
	ExchangeRate        string `json:"exchange_rate"`
	OriginalAmount      string `json:"original_amount"`
	OriginalCurrency    string `json:"original_currency"`
	PaymentAttributesID uint   `gorm:"unique;not null" json:"-"`
}

CurrencyExchange resource

func ValidCurrencyExchange

func ValidCurrencyExchange() CurrencyExchange

ValidCurrencyExchange an example of a valid currency exchange

type Money

type Money struct {
	ID        uint   `gorm:"primary_key" json:"-"`
	Amount    string `json:"amount"`
	Currency  string `json:"currency"`
	ChargesID uint   `gorm:"not null" json:"-"`
}

Money makes the world go round

func ValidMoney

func ValidMoney() Money

ValidMoney an example of a valid money

type Party

type Party struct {
	ID                uint   `gorm:"primary_key" json:"-"`
	AccountName       string `json:"account_name,omitempty"`
	AccountNumber     string `gorm:"unique_index:bankacc" json:"account_number,omitempty"`
	AccountNumberCode string `json:"account_number_code,omitempty"`
	AccountType       int    `json:"account_type"`
	Address           string `json:"address,omitempty"`
	BankID            string `gorm:"unique_index:bankacc" json:"bank_id,omitempty"`
	BankIDCode        string `gorm:"unique_index:bankacc" json:"bank_id_code,omitempty"`
	Name              string `json:"name,omitempty"`
}

Party resource

func ValidParty

func ValidParty() Party

ValidParty an example of a valid party

type Payment

type Payment struct {
	ID             string            `json:"id,omitempty"`
	Type           string            `json:"type,omitempty"`
	Version        int64             `json:"version"`
	OrganisationID string            `json:"organisation_id,omitempty"`
	Attributes     PaymentAttributes `gorm:"foreignkey:InternalPaymentID" json:"attributes,omitempty"`
}

Payment resource

func ValidPayment

func ValidPayment() *Payment

ValidPayment an example of a valid payment

type PaymentAttributes

type PaymentAttributes struct {
	ID                   uint             `gorm:"primary_key" json:"-"`
	Amount               string           `json:"amount,omitempty"`
	Currency             string           `json:"currency,omitempty"`
	EndToEndReference    string           `json:"end_to_end_reference,omitempty"`
	NumericReference     string           `json:"numeric_reference,omitempty"`
	PaymentID            string           `json:"payment_id,omitempty"`
	PaymentPurpose       string           `json:"payment_purpose,omitempty"`
	PaymentScheme        string           `json:"payment_scheme,omitempty"`
	PaymentType          string           `json:"payment_type,omitempty"`
	ProcessingDate       string           `json:"processing_date,omitempty"`
	Reference            string           `json:"reference,omitempty"`
	SchemePaymentSubType string           `json:"scheme_payment_sub_type,omitempty"`
	SchemePaymentType    string           `json:"scheme_payment_type,omitempty"`
	InternalPaymentID    string           `gorm:"unique;not null" json:"-"`
	BeneficiaryParty     Party            `json:"beneficiary_party,omitempty"`
	BeneficiaryPartyID   uint             `json:"-"`
	DebtorParty          Party            `json:"debtor_party,omitempty"`
	DebtorPartyID        uint             `json:"-"`
	SponsorParty         Party            `json:"sponsor_party,omitempty"`
	SponsorPartyID       uint             `json:"-"`
	ForeignExchange      CurrencyExchange `json:"fx,omitempty"`
	ChargesInformation   Charges          `json:"charges_information,omitempty"`
}

PaymentAttributes resource

func ValidPaymentAttributes

func ValidPaymentAttributes() PaymentAttributes

ValidPaymentAttributes an example of a valid paymentattributes

Jump to

Keyboard shortcuts

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