listener

package
v0.0.0-...-c9303cd Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP interface {
	Do(req *http.Request) (resp *http.Response, err error)
}

HTTP represents an http client that a payment listener can use to make HTTP requests.

type PaymentListener

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

PaymentListener is listening for a new payments received by ReceivingAccount

func NewPaymentListener

func NewPaymentListener(
	config *config.Config,
	database db.Database,
	aurora hc.ClientInterface,
	now func() time.Time,
) (pl PaymentListener, err error)

NewPaymentListener creates a new PaymentListener

func (*PaymentListener) ConvertToBridgePayment

func (pl *PaymentListener) ConvertToBridgePayment(op operations.Operation) (bridge.PaymentResponse, error)

ConvertToBridgePayment constructs a bridge.PaymentResponse struct from the operation received from aurora. This is done in order to have a standard response because the response from aurora can either be a payment, path_payment or account_merge operation; all of which have different fields.

func (*PaymentListener) Listen

func (pl *PaymentListener) Listen() (err error)

Listen starts listening for new payments

func (*PaymentListener) ReprocessPayment

func (pl *PaymentListener) ReprocessPayment(payment bridge.PaymentResponse, force bool) error

Jump to

Keyboard shortcuts

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