paymentrequest

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPaymentRequestAlreadyExists = errors.New("payment request record already exists")
	ErrPaymentRequestNotFound      = errors.New("no payment request records could be found")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	Id uint64

	Intent string

	// Payment fields
	DestinationTokenAccount *string
	ExchangeCurrency        *string
	NativeAmount            *float64
	ExchangeRate            *float64
	Quantity                *uint64

	// Login fields
	Domain     *string
	IsVerified bool

	CreatedAt time.Time
}

Currently, the model supports payment, login, or both.

todo: Refactor to a structure similar to intent as we add more request use cases.

func (*Record) Clone

func (r *Record) Clone() Record

func (*Record) CopyTo

func (r *Record) CopyTo(dst *Record)

func (*Record) HasLogin added in v1.2.0

func (r *Record) HasLogin() bool

func (*Record) RequiresPayment added in v1.2.0

func (r *Record) RequiresPayment() bool

func (*Record) Validate

func (r *Record) Validate() error

type Store

type Store interface {
	// Put creates a new payment request record
	Put(ctx context.Context, record *Record) error

	// Get gets a paymen request record by its intent ID
	Get(ctx context.Context, intentId string) (*Record, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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