producer

package
v0.0.0-...-3414fa2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPaymentCreatedEvent

func NewPaymentCreatedEvent(
	orderNo string,
	paymentNo string,
	amount float64,
	paymentMethod int32,
	payURL string,
) *types.PaymentCreatedEvent

func NewPaymentFailedEvent

func NewPaymentFailedEvent(
	orderNo string,
	paymentNo string,
	amount float64,
	reason string,
	errorCode string,
) *types.PaymentFailedEvent

func NewPaymentRefundEvent

func NewPaymentRefundEvent(
	orderNo string,
	paymentNo string,
	refundNo string,
	refundAmount float64,
	reason string,
	refundTime time.Time,
) *types.PaymentRefundEvent

func NewPaymentSuccessEvent

func NewPaymentSuccessEvent(
	orderNo string,
	paymentNo string,
	amount float64,
	paymentMethod int32,
	paidTime time.Time,
) *types.PaymentSuccessEvent

func NewPaymentVerificationEvent

func NewPaymentVerificationEvent(
	orderNo string,
	paymentNo string,
	verified bool,
	message string,
) *types.PaymentVerificationEvent

Types

type PaymentProducer

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

func NewPaymentProducer

func NewPaymentProducer(ch *amqp.Channel, exchange string) *PaymentProducer

func (*PaymentProducer) Close

func (p *PaymentProducer) Close() error

func (*PaymentProducer) PublishPaymentCreated

func (p *PaymentProducer) PublishPaymentCreated(ctx context.Context, event *types.PaymentCreatedEvent) error

func (*PaymentProducer) PublishPaymentFailed

func (p *PaymentProducer) PublishPaymentFailed(ctx context.Context, event *types.PaymentFailedEvent) error

func (*PaymentProducer) PublishPaymentRefund

func (p *PaymentProducer) PublishPaymentRefund(ctx context.Context, event *types.PaymentRefundEvent) error

func (*PaymentProducer) PublishPaymentSuccess

func (p *PaymentProducer) PublishPaymentSuccess(ctx context.Context, event *types.PaymentSuccessEvent) error

func (*PaymentProducer) PublishPaymentVerification

func (p *PaymentProducer) PublishPaymentVerification(ctx context.Context, event *types.PaymentVerificationEvent) error

Jump to

Keyboard shortcuts

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