payment

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFiatProcessorType

func IsFiatProcessorType(typ accounts.Type) bool

Is the payment processor type handle fiat

func Query

Types

type Payment

type Payment struct {
	mixin.Model

	// Deprecated
	Type accounts.Type `json:"type"`

	// Order this payment is associated with
	OrderId string `json:"orderId,omitempty"`

	// User this payment is associated with
	UserId string `json:"userId,omitempty"`

	// Payment source information
	Account accounts.Account `json:"account"`

	// Immutable buyer data from time of payment, may or may not be associated
	// with a user.
	Buyer Buyer `json:"buyer"`

	Currency currency.Type `json:"currency"`

	CampaignId string `json:"campaignId,omitempty"`

	Amount         currency.Cents `json:"amount"`
	AmountRefunded currency.Cents `json:"amountRefunded"`
	Fee            currency.Cents `json:"fee"`
	FeeIds         []string       `json:"fees" datastore:",noindex"`

	AmountTransferred   currency.Cents `json:"-"`
	CurrencyTransferred currency.Type  `json:"-"`

	Description string `json:"description,omitempty"`
	Status      Status `json:"status"`

	// Client's browser, associated info
	Client client.Client `json:"client,omitempty"`

	// Whether this payment has been captured or not
	Captured bool `json:"captured"`

	// Stripe livemode
	Live bool `json:"live"`

	// Internal testing flag
	Test bool `json:"-"`

	Metadata  Map    `json:"metadata,omitempty" datastore:"-"`
	Metadata_ string `json:"-" datastore:",noindex"`
}

func Fake

func Fake(db *datastore.Datastore) *Payment

func New

func New(db *datastore.Datastore) *Payment

func (*Payment) Defaults

func (p *Payment) Defaults()

func (*Payment) GetFees

func (p *Payment) GetFees() ([]*fee.Fee, error)

func (*Payment) Init

func (p *Payment) Init(db *datastore.Datastore)

func (Payment) Kind

func (p Payment) Kind() string

func (*Payment) Load

func (p *Payment) Load(ps []datastore.Property) (err error)

func (*Payment) Save

func (p *Payment) Save() (ps []datastore.Property, err error)

type Status

type Status string
const (
	Cancelled  Status = "cancelled"
	Credit     Status = "credit"
	Disputed   Status = "disputed"
	Failed     Status = "failed"
	Fraudulent Status = "fraudulent"
	Refunded   Status = "refunded"
	Unpaid     Status = "unpaid"
)

Jump to

Keyboard shortcuts

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