payment

package
v1.1.24 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Purchase(ctx context.Context, i *Invoice) (*Invoice, error)
	Pay(i *Invoice) *PayResponse
	Verify(ctx context.Context, amount uint64, args map[string]string) (*Receipt, error)
}

type Invoice

type Invoice struct {
	ID            uuid.UUID
	Amount        uint64
	Currency      string
	TransactionID string
	Details       map[string]string
	Driver        *Driver
}

func (*Invoice) Get

func (i *Invoice) Get(key string) string

func (*Invoice) Has

func (i *Invoice) Has(key string) bool

func (*Invoice) Set

func (i *Invoice) Set(key, value string)

type MetaData

type MetaData interface {
	Details() map[string]string
	Set(key, value string)
	Get(key string) string
	Has(key string) bool
}

type PayResponse

type PayResponse struct {
	URL         string
	HasRedirect bool
}

type Paymenter

type Paymenter interface {
	Via(driver *Driver)
	Driver() string
	Callback(url string) string
	Amount(amount uint64)
	Detail(details map[string]string)
	TransactionID(id string)
	Invoice() *Invoice
	Purchase(i *Invoice)
	Verify() *Receipt
}

type Receipt

type Receipt struct {
	RefID   string
	Details map[string]string
}

Jump to

Keyboard shortcuts

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