paymentrequest

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 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")
	ErrInvalidPaymentRequest       = errors.New("payment request is invalid")
)

Functions

This section is empty.

Types

type Fee added in v1.4.0

type Fee struct {
	DestinationTokenAccount string
	BasisPoints             uint16
}

func (*Fee) Clone added in v1.4.0

func (f *Fee) Clone() Fee

func (*Fee) CopyTo added in v1.4.0

func (f *Fee) CopyTo(dst *Fee)

func (*Fee) Validate added in v1.4.0

func (f *Fee) Validate() error

type Record

type Record struct {
	Id uint64

	Intent string

	// Payment fields
	DestinationTokenAccount *string
	ExchangeCurrency        *string
	NativeAmount            *float64
	ExchangeRate            *float64
	Quantity                *uint64
	Fees                    []*Fee

	// 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