models

package
v0.0.0-...-a7280fd Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountId    string
	Username     string
	PasswordHash string
}

type AccountChange

type AccountChange struct {
	AccountId   string `json:"account_id"`
	NewPassword string `json:"new_password"`
	OldPassword string `json:"old_password"`
}

type AccountStats

type AccountStats struct {
	CreationDate time.Time
	LastLogin    time.Time
}

type AdminDashboardInfo

type AdminDashboardInfo struct {
	Stats          InstanceStats `json:"instance_stats"`
	RecentPayments []Payment     `json:"recent_payments"`
}

type ApiError

type ApiError struct {
	Msg    string `json:"message"`
	Code   int    `json:"code"`
	Status int
}

type ApiTokenInfo

type ApiTokenInfo struct {
	AccountId  string    `json:"account_id,omitempty"`
	Token      string    `json:"token"`
	ValidUntil time.Time `json:"valid_until"`
}

type CallbackSecret

type CallbackSecret struct {
	AccountId  string    `json:"account_id,omitempty"`
	SecretKey  string    `json:"secret_key"`
	ValidUntil time.Time `json:"valid_until"`
}

type Instance

type Instance struct {
	Version                string `json:"version,omitempty"`
	DefaultCommission      uint64 `json:"default_commission"`
	DefaultCommissionFloat string `json:"default_commission_float,omitempty"`

	// Allow multiple merchants to use this instance and store their funds
	// in the instance's wallet.
	CustodialMode bool `json:"custodial_mode"`

	// If false, the instance is invite-only. If custodial mode is off
	// registrations can't be allowed.
	RegistrationsAllowed bool `json:"registrations_allowed"`

	// Decide when auto withdrawals should happen if custodial mode is on.
	WithdrawalTimes string `json:"withdrawal_times"`
}

type InstanceBootstrap

type InstanceBootstrap struct {
	// Flag to indicate bootstrapping is needed:
	// Creation of admin account, default theme etc.
	FirstRun bool `json:"first_run"`
}

type InstanceInfo

type InstanceInfo struct {
	Details Instance      `json:"details"`
	Stats   InstanceStats `json:"stats"`
}

type InstanceStats

type InstanceStats struct {
	// Total fees paid by merchants
	WalletBalance      uint64 `json:"wallet_balance"`
	WalletBalanceFloat string `json:"wallet_balance_float,omitempty"`
	TotalProfits       uint64 `json:"total_profits"`
	TotalProfitsFloat  string `json:"total_profits_float,omitempty"`
	TotalMerchants     uint64 `json:"total_merchants"`
}

type Merchant

type Merchant struct {
	AccountId      string `json:"id"`
	Name           string `json:"name"`
	CommissionRate uint64 `json:"commission_rate"`
	WalletAddress  string `json:"wallet_address"`
	TemplateId     string `json:"template_id"`
	Disabled       bool   `json:"disabled"`
}

type MerchantAPIKeys

type MerchantAPIKeys struct {
	AccountId  string    `json:"merchant_id"`
	KeyId      string    `json:"key_id"`
	Secret     string    `json:"secret"`
	ValidUntil time.Time `json:"valid_until"`
}

type MerchantDashboardInfo

type MerchantDashboardInfo struct {
	Stats          MerchantStats `json:"merchant_stats"`
	RecentPayments []Payment     `json:"recent_payments"`
}

type MerchantSettings

type MerchantSettings struct {
	AccountId      string  `json:"account_id,omitempty"`
	CommissionRate *uint64 `json:"commission_rate,omitempty"`
	Disabled       *bool   `json:"disabled,omitempty"`
}

type MerchantStats

type MerchantStats struct {
	AccountId       string `json:"merchant_id,omitempty"`
	Balance         uint64 `json:"balance"`
	BalanceFloat    string `json:"omitempty"`
	TotalSales      uint64 `json:"total_sales"`
	TotalSalesFloat string `json:"omitempty"`
}

type NewAccount

type NewAccount struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Role     string `json:"role"`
}

type Payment

type Payment struct {
	InvoiceId    string `json:"invoice_id"`
	MerchantName string `json:"merchant_name"`
	Amount       uint64 `json:"amount"`
	AmountFloat  string `json:"amount_float,omitempty"`
	Fee          uint64 `json:"fee"`
	FeeFloat     string `json:"fee_float,omitempty"`
	// Merchant provided ID for this payment
	OrderId string `json:"order_id,omitempty"`

	// Possible statuses: pending, confirming, finished, cancelled, withdrawn
	Status     string    `json:"status"`
	LastUpdate time.Time `json:"last_update"`
}

type PaymentFull

type PaymentFull struct {
	InvoiceId    string `json:"invoice_id"`
	MerchantName string `json:"merchant_name"`
	Amount       uint64 `json:"amount"`
	AmountFloat  string `json:"amount_float,omitempty"`
	Fee          uint64 `json:"fee"`
	FeeFloat     string `json:"fee_float,omitempty"`

	// Merchant provided ID for this payment
	OrderId string `json:"order_id,omitempty"`

	// Possible statuses: pending, confirming, finished, cancelled, withdrawn
	Status     string    `json:"status"`
	LastUpdate time.Time `json:"last_update"`

	AcceptUrl   string `json:"accept_url,omitempty"`
	CancelUrl   string `json:"cancel_url,omitempty"`
	CallbackUrl string `json:"callback_url,omitempty"`
	Address     string `json:"address"`
	// Merchant provided extra data field
	ExtraData string `json:"extra_data,omitempty"`
}

Contains all information related to a payment

type PaymentPageInfo

type PaymentPageInfo struct {
	InvoiceId    string `json:"invoice_id"`
	MerchantName string `json:"merchant_name"`
	TemplateId   string `json:"template_id"`
	Amount       uint64 `json:"amount"`
	AmountFloat  string `json:"amount_float,omitempty"`

	// Merchant provided ID for this payment
	OrderId string `json:"order_id,omitempty"`

	// Possible statuses: pending, confirming, finished, cancelled, withdrawn
	Status     string    `json:"status"`
	LastUpdate time.Time `json:"last_update"`
	AcceptUrl  string    `json:"accept_url,omitempty"`
	CancelUrl  string    `json:"cancel_url,omitempty"`
	Address    string    `json:"address"`
	Qr         string    `json:"qr"`

	// Merchant provided extra data field
	ExtraData string `json:"extra_data,omitempty"`
}

Payment data passed to checkout page template

type PostPaymentRequest

type PostPaymentRequest struct {
	Amount uint64 `json:"amount"`

	// Merchant provided ID for this payment
	OrderId string `json:"order_id,omitempty"`

	// URL for redirection based on customer actions.
	// These variables are passed to the merchant template.
	AcceptUrl   string `json:"accept_url,omitempty"`
	CancelUrl   string `json:"cancel_url,omitempty"`
	CallbackUrl string `json:"callback_url,omitempty"`

	// Merchant provided extra data field
	ExtraData string `json:"extra_data,omitempty"`
}

type PostPaymentResponse

type PostPaymentResponse struct {
	PaymentId string `json:"payment_id"`
	Address   string `json:"address"`
}

type Theme

type Theme struct {
	ThemeId   string
	Name      string
	AccountId string
}

type Withdrawal

type Withdrawal struct {
	Id           string    `json:"withdrawal_id"`
	MerchantName string    `json:"merchant_name"`
	AccountId    string    `json:"merchant_id,omitempty"`
	Amount       uint64    `json:"amount"`
	AmountFloat  string    `json:"amount_float,omitempty"`
	Date         time.Time `json:"date"`
}

type WithdrawalRequest

type WithdrawalRequest struct {
	Address string `json:"address"`
}

Jump to

Keyboard shortcuts

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