paymentservice

package
v0.0.0-...-f5f0fde Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrdersRepository

type OrdersRepository interface {
	ChangeOrderStatus(ctx context.Context, orderId string, newStatus models.OrderItemStatus) error
	ChangeOrderItemsStatus(ctx context.Context, orderId string,
		itemsIds []string, newStatus models.OrderItemStatus) error
	GetOrderTotalPrice(ctx context.Context, orderId string) (uint32, error)
	GetOrderItemsTotalPrice(ctx context.Context, orderId string, itemsIds []string) (uint32, error)
}

type PaymentServiceStub

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

func NewPaymentServiceStub

func NewPaymentServiceStub(paymentStubUrl string,
	paymentSleepTime time.Duration,
	refundSleepTime time.Duration,
	repo OrdersRepository,
	logger *logrus.Logger,
) *PaymentServiceStub

func (*PaymentServiceStub) ChangeOrderItemsStatus

func (s *PaymentServiceStub) ChangeOrderItemsStatus(ctx context.Context, orderId string,
	itemsIds []string, newStatus models.OrderItemStatus) (err error)

func (*PaymentServiceStub) ChangeOrderStatus

func (s *PaymentServiceStub) ChangeOrderStatus(ctx context.Context, orderId string, newStatus models.OrderItemStatus) (err error)

func (*PaymentServiceStub) PreparePaymentUrl

func (s *PaymentServiceStub) PreparePaymentUrl(ctx context.Context, email string, total uint32, orderId string) (paymenturl string, err error)

func (*PaymentServiceStub) RequestOrderItemsRefund

func (s *PaymentServiceStub) RequestOrderItemsRefund(ctx context.Context,
	percent uint32, orderId string, itemsIds []string) (err error)

func (*PaymentServiceStub) RequestOrderRefund

func (s *PaymentServiceStub) RequestOrderRefund(ctx context.Context, percent uint32, orderId string) (err error)

Jump to

Keyboard shortcuts

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