service

package
v0.0.0-...-7544875 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Order

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

func NewOrder

func NewOrder(order OrderRepository, payment PaymentRepository) *Order

func (*Order) Checkout

func (o *Order) Checkout(ctx context.Context, orders order.Order) (order.Order, error)

Checkout is lock items to order before doing payment transaction

func (*Order) Placed

func (o *Order) Placed(ctx context.Context, paymentTrxID string) (order.Order, error)

Placed is creating order from payment service

type OrderRepository

type OrderRepository interface {
	Create(ctx context.Context, args order.Order) (order.Order, error)
	UpdateStatusOrder(ctx context.Context, paymentTrxID string) error
	FindPayload(ctx context.Context, paymentTrxID string) (order.Order, error)
	CreateDetail(ctx context.Context, orders order.Order) error
}

type PaymentRepository

type PaymentRepository interface {
	Register(ctx context.Context, args order.Payment) (string, error)
}

Jump to

Keyboard shortcuts

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