placeorder

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: OSL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const AttributeErrorKey = "test-error"

AttributeErrorKey is used to store a forced test error to the cart's additional attributes

Variables

View Source
var (

	// NextCancelFails can be set to let the next call to any FakeAdapter's instance fail
	NextCancelFails bool
)

Functions

This section is empty.

Types

type FakeAdapter

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

FakeAdapter provides fake place order adapter

func (*FakeAdapter) CancelCustomerOrder

func (f *FakeAdapter) CancelCustomerOrder(ctx context.Context, orderInfos placeorder.PlacedOrderInfos, auth authDomain.Auth) error

CancelCustomerOrder cancels a customer order

func (*FakeAdapter) CancelGuestOrder

func (f *FakeAdapter) CancelGuestOrder(ctx context.Context, orderInfos placeorder.PlacedOrderInfos) error

CancelGuestOrder cancels a guest order

func (*FakeAdapter) Inject

func (f *FakeAdapter) Inject() *FakeAdapter

Inject dependencies

func (*FakeAdapter) PlaceCustomerCart

func (f *FakeAdapter) PlaceCustomerCart(ctx context.Context, auth authDomain.Auth, cart *cartDomain.Cart, payment *placeorder.Payment) (placeorder.PlacedOrderInfos, error)

PlaceCustomerCart places a customer cart

func (*FakeAdapter) PlaceGuestCart

func (f *FakeAdapter) PlaceGuestCart(ctx context.Context, cart *cartDomain.Cart, payment *placeorder.Payment) (placeorder.PlacedOrderInfos, error)

PlaceGuestCart places a guest cart order

func (*FakeAdapter) ReserveOrderID

func (f *FakeAdapter) ReserveOrderID(_ context.Context, cart *cartDomain.Cart) (string, error)

ReserveOrderID returns the reserved order id

type Module

type Module struct {
}

Module registers our fake place order module

func (*Module) Configure

func (m *Module) Configure(injector *dingo.Injector)

Configure module

Jump to

Keyboard shortcuts

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