handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adjustment

type Adjustment struct {
	ID         string
	Created    time.Time
	Amount     int64  // positive is credit, negative is debit
	Reference  string // reference description
	Visible    bool   // should this be visible to the customer? If false, it only displays to admins
	CustomerID string
	ActionedBy string // who made the adjustment
	Meta       map[string]string
}

Adjustment represents a balance adjustment (not including normal API usage). e.g. credit being added, promo codes, manual adjustment for customer service etc

type Balance

type Balance struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(svc *service.Service) *Balance

func (*Balance) Current

func (b *Balance) Current(ctx context.Context, request *pb.CurrentRequest, response *pb.CurrentResponse) error

func (*Balance) Decrement

func (b *Balance) Decrement(ctx context.Context, request *pb.DecrementRequest, response *pb.DecrementResponse) error

func (*Balance) DeleteCustomer

func (b *Balance) DeleteCustomer(ctx context.Context, request *pb.DeleteCustomerRequest, response *pb.DeleteCustomerResponse) error

func (Balance) Increment

func (b Balance) Increment(ctx context.Context, request *pb.IncrementRequest, response *pb.IncrementResponse) error

func (*Balance) ListAdjustments

func (b *Balance) ListAdjustments(ctx context.Context, request *pb.ListAdjustmentsRequest, response *pb.ListAdjustmentsResponse) error

func (*Balance) Transfer

func (b *Balance) Transfer(ctx context.Context, req *pb.TransferRequest, rsp *pb.TransferResponse) error

Jump to

Keyboard shortcuts

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