cart

package
v0.0.0-...-f5d69d6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckoutPrimaryPort

type CheckoutPrimaryPort interface {
	PlaceOrder(order *Order) error
}

CheckoutPrimaryPort is the entrypoint for the checkout Package

func NewCheckoutService

func NewCheckoutService(repo CheckoutSecondaryPort) CheckoutPrimaryPort

NewCheckoutService receives a Secondary Port of domain and insantiates a Primary Port

type CheckoutSecondaryPort

type CheckoutSecondaryPort interface {
	SendOrderForProcessing(order *Order) error
}

CheckoutSecondaryPort is the way the business rules communicate to the external world

type Order

type Order struct {
	ID           string  `json:"id"`
	Email        string  `json:"email"`
	Amount       float64 `json:"amount"`
	Currency     string  `json:"currency"`
	ProductID    int     `json:"productid"`
	PaymentToken string  `json:"paymenttoken"`
}

Order represents a buying order from a customer

type ProcessPrimaryPort

type ProcessPrimaryPort interface {
	ProcessOrder(order *Order) error
}

ProcessPrimaryPort is the entrypoint for the checkout Package

func NewProcessService

func NewProcessService(repo ProcessSecondaryPort) ProcessPrimaryPort

NewProcessService receives a Secondary Port of domain and insantiates a Primary Port

type ProcessSecondaryPort

type ProcessSecondaryPort interface {
	Save(order *Order) error
}

ProcessSecondaryPort is the way the business rules communicate to the external world

Jump to

Keyboard shortcuts

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