handler

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

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

	NotificationActionCheck     = "check"
	NotificationActionPayment   = "payment"
	NotificationActionCheckUser = "check_user"

	RetryDlxTimeout     = 600
	WaitRetryDlxTimeout = 60
	WaitRetryMaxCount   = 10
	RetryExchangeName   = "notify-payment-retry"
	RetryMaxCount       = 288

	RetryBillingDlxTimeout   = 60
	RetryBillingExchangeName = "notify-payment-billing-retry"
	RetryBillingMaxCount     = 10

	CountryCodeUSA = "US"
)
View Source
const (
	AmountPrecisionDefault = int64(2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CardPay

type CardPay Empty

func (*CardPay) Notify

func (n *CardPay) Notify() error

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,
	retBillingBrok rabbitmq.BrokerInterface,
	taxjarTransactionsBroker rabbitmq.BrokerInterface,
	taxjarRefundsBroker rabbitmq.BrokerInterface,
	redis redis.Cmdable,
	dlv amqp.Delivery,
	cfg *config.Config,
	centrifugoPaymentForm centrifugo.CentrifugoInterface,
	centrifugoDashboard centrifugo.CentrifugoInterface,
	sender http_sender.HttpSender,
	httpClient *http.Client,
	slack slack.SenderInterface,
	waitRetryBroker rabbitmq.BrokerInterface,
) *Handler

func (*Handler) GetNotifier

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

func (*Handler) HandleError

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

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