Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountType ¶
type AccountType int
AccountType type and constants.
const ( BasicAccount AccountType = iota PremiumAccount )
Dummy constants that don't do anything currently.
type Charge ¶
type Charge struct {
ID uint `json:"-" gorm:"primary_key"`
BearerCode string `json:"bearer_code,omitempty"`
ReceiverChargesAmount string `json:"receiver_charges_amount,omitempty" gorm:"type:decimal(1000,2)"`
ReceiverChargesCurrency string `json:"receiver_charges_currency,omitempty"`
SenderCharges []*CurrencyAmount `json:"sender_charges,omitempty" gorm:"foreignkey:ChargeID"`
}
Charge struct used in Payment struct.
type CurrencyAmount ¶
type CurrencyAmount struct {
ID uint `json:"-" gorm:"primary_key"`
ChargeID uint `json:"-" gorm:"type:integer REFERENCES charges(id)"`
Amount string `json:"amount,omitempty" gorm:"type:decimal(1000,2)"`
Currency string `json:"currency,omitempty"`
}
CurrencyAmount used in Charge struct.
type FX ¶
type FX struct {
ID uint `json:"-" gorm:"primary_key"`
ContractReference string `json:"contract_reference,omitempty"`
ExchangeRate string `json:"exchange_rate,omitempty" gorm:"type:decimal(10,5)"`
OriginalAmount string `json:"original_amount,omitempty" gorm:"type:decimal(1000,2)"`
OriginalCurrency string `json:"original_currency,omitempty"`
}
FX struct used in Payment struct.
type Model ¶
type Model struct {
ID uuid.UUID `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index"`
}
Model struct for models that have a uuid as primary key. Based on `gorm.Model`, to be embedded in other models. Implements “ and
func (*Model) BeforeCreate ¶
BeforeCreate callback method for `gorm` package. Makes sure a uuid is set before a Model is created.
type Organisation ¶
Organisation model that represents an organisation. Can be marshaled to a json resource according to the json:api specification.
func (*Organisation) GetReferencedIDs ¶
func (org *Organisation) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs method required to implement `jsonapi.MarshalLinkedRelations`.
func (*Organisation) GetReferences ¶
func (org *Organisation) GetReferences() []jsonapi.Reference
GetReferences method required to implement `jsonapi.MarshalReferences`.
type Party ¶
type Party struct {
ID uint `json:"-" gorm:"primary_key"`
AccountName string `json:"account_name,omitempty"`
AccountNumber string `json:"account_number,omitempty"`
AccountNumberCode string `json:"account_number_code,omitempty"`
AccountType AccountType `json:"account_type,omitempty"`
Address string `json:"address,omitempty"`
BankID string `json:"bank_id,omitempty"`
BankIDCode string `json:"bank_id_code,omitempty"`
Name string `json:"name,omitempty"`
}
Party struct used in Payment struct.
type Payment ¶
type Payment struct {
Model `json:"-"`
OrganisationID uuid.UUID `json:"-" gorm:"type:uuid REFERENCES organisations(id)"`
Organisation Organisation `json:"-" gorm:"association_autoupdate:false"`
Amount string `json:"amount,omitempty" gorm:"type:decimal(1000,2)"`
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"`
BeneficiaryPartyID sql.NullInt64 `json:"-" gorm:"type:integer REFERENCES parties(id)"`
BeneficiaryParty *Party `json:"beneficiary_party,omitempty"`
DebtorPartyID sql.NullInt64 `json:"-" gorm:"type:integer REFERENCES parties(id)"`
DebtorParty *Party `json:"debtor_party,omitempty"`
SponsorPartyID sql.NullInt64 `json:"-" gorm:"type:integer REFERENCES parties(id)"`
SponsorParty *Party `json:"sponsor_party,omitempty"`
ChargesInformationID sql.NullInt64 `json:"-" gorm:"type:integer REFERENCES charges(id)"`
ChargesInformation *Charge `json:"charges_information,omitempty"`
FXID sql.NullInt64 `json:"-" sql:"type:integer REFERENCES fxes(id)"`
FX *FX `json:"fx,omitempty"`
}
Payment struct represents a payment. Instances of this struct can be marshaled to a json resource according to the json:api specification.
func (*Payment) GetReferencedIDs ¶
func (payment *Payment) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs method required to implement `jsonapi.MarshalLinkedRelations`
func (*Payment) GetReferences ¶
GetReferences method required to implement `jsonapi.MarshalReferences`.
func (*Payment) SetToOneReferenceID ¶
SetToOneReferenceID method required to implement `jsonapi.UnmarshalToOneRelations`, which we need to set the organisation relationship.