handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoggerNotificationCentrifugo = "Send message to centrifugo failed"
	LoggerNotificationRedis      = "Set stat in redis failed"

	MIMEApplicationJSON = "application/json"

	HeaderAccept        = "Accept"
	HeaderContentType   = "Content-Type"
	HeaderSignature     = "Signature"
	HeaderAuthorization = "Authorization"

	NotificationActionCheck   = "check"
	NotificationActionPayment = "payment"

	RetryDlxTimeout   = 600
	RetryExchangeName = "notify-payment-retry"
	RetryMaxCount     = 288

	CountryCodeUSA = "US"
)

Variables

Functions

This section is empty.

Types

type CardPay

type CardPay Empty

func (*CardPay) Notify

func (n *CardPay) Notify() error

type Centrifugo added in v1.1.0

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

func (*Centrifugo) Publish added in v1.1.0

func (c *Centrifugo) Publish(ctx context.Context, channel string, msg interface{}) error

type CentrifugoInterface added in v1.1.0

type CentrifugoInterface interface {
	Publish(context.Context, string, interface{}) error
}

func NewCentrifugo added in v1.1.0

func NewCentrifugo(cfg *config.Centrifugo, httpClient *http.Client) CentrifugoInterface

type Default

type Default Empty

func (*Default) Notify

func (n *Default) Notify() error

type Empty

type Empty struct {
	*Handler
}

func (*Empty) Notify

func (n *Empty) Notify() error

type Handler

type Handler struct {
	RetryCount int32
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	o *billingpb.Order,
	rep billingpb.BillingService,
	retBrok rabbitmq.BrokerInterface,
	taxjarTransactionsBroker rabbitmq.BrokerInterface,
	taxjarRefundsBroker rabbitmq.BrokerInterface,
	redis *redis.Client,
	dlv amqp.Delivery,
	cfg *config.Config,
	centrifugoPaymentForm CentrifugoInterface,
	centrifugoDashboard CentrifugoInterface,
) *Handler

func (*Handler) GetNotifier

func (h *Handler) GetNotifier() (Notifier, error)

func (*Handler) HandleError

func (h *Handler) HandleError(msg string, err error, t Table)

func (*Handler) SendToUserCentrifugo

func (h *Handler) SendToUserCentrifugo(order *billingpb.Order) error

type NotificationStat

type NotificationStat struct {
	StatKey string
	// contains filtered or unexported fields
}

func (*NotificationStat) Get

func (ns *NotificationStat) Get(key string) bool

type Notifier

type Notifier interface {
	Notify() error
}

type OrderNotificationMessage

type OrderNotificationMessage struct {
	Id          string           `json:"id"`
	Type        string           `json:"type"`
	Event       string           `json:"event"`
	Live        bool             `json:"live"`
	CreatedAt   string           `json:"created_at"`
	ExpiresAt   string           `json:"expires_at"`
	DeliveryTry int32            `json:"delivery_try"`
	Object      *billingpb.Order `json:"object"`
}

type Table

type Table map[string]interface{}

type XSolla

type XSolla Empty

func (*XSolla) Notify

func (n *XSolla) Notify() error

Jump to

Keyboard shortcuts

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