handler

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction 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
	WalletID   string
	ActionedBy string // who made the transaction
	Metadata   map[string]string
}

Transaction represents a wallet transaction

type Wallet

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

func NewHandler

func NewHandler(svc *service.Service) *Wallet

func (*Wallet) Balance

func (b *Wallet) Balance(ctx context.Context, request *pb.BalanceRequest, response *pb.BalanceResponse) error

func (*Wallet) Create

func (b *Wallet) Create(ctx context.Context, request *pb.CreateRequest, response *pb.CreateResponse) error

func (*Wallet) Credit

func (b *Wallet) Credit(ctx context.Context, request *pb.CreditRequest, response *pb.CreditResponse) error

func (*Wallet) Debit

func (b *Wallet) Debit(ctx context.Context, request *pb.DebitRequest, response *pb.DebitResponse) error

func (*Wallet) Delete

func (b *Wallet) Delete(ctx context.Context, request *pb.DeleteRequest, response *pb.DeleteResponse) error

func (*Wallet) List

func (w *Wallet) List(ctx context.Context, req *pb.ListRequest, rsp *pb.ListResponse) error

func (*Wallet) Read

func (w *Wallet) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error

func (*Wallet) Transactions

func (b *Wallet) Transactions(ctx context.Context, request *pb.TransactionsRequest, response *pb.TransactionsResponse) error

func (*Wallet) Transfer

func (b *Wallet) 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