states

package
v0.0.0-...-bb92df6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: OSL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostRedirectStateData

func NewPostRedirectStateData(url *url.URL, formParameter map[string]FormField) process.StateData

NewPostRedirectStateData creates new StateData with (persisted) Data required for this state

func NewRedirectStateData

func NewRedirectStateData(url *url.URL) process.StateData

NewRedirectStateData creates data required for this state

func NewShowHTMLStateData

func NewShowHTMLStateData(html string) process.StateData

NewShowHTMLStateData creates new StateData required for this ShowHTML state

func NewShowIframeStateData

func NewShowIframeStateData(url *url.URL) process.StateData

NewShowIframeStateData creates new state data for this state

func NewShowWalletPaymentStateData

func NewShowWalletPaymentStateData(walletDetails ShowWalletPaymentData) process.StateData

NewShowWalletPaymentStateData creates new StateData with (persisted) Data required for this state

Types

type CompleteCart

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

CompleteCart state

func (*CompleteCart) Inject

func (c *CompleteCart) Inject(
	cartService *application.CartService,
	cartReceiverService *application.CartReceiverService,
) *CompleteCart

Inject dependencies

func (CompleteCart) IsFinal

func (c CompleteCart) IsFinal() bool

IsFinal if state is a final state

func (CompleteCart) Name

func (CompleteCart) Name() string

Name get state name

func (CompleteCart) Rollback

func (c CompleteCart) Rollback(ctx context.Context, data process.RollbackData) error

Rollback the state operations

func (CompleteCart) Run

Run the state operations

type CompleteCartRollbackData

type CompleteCartRollbackData struct {
	CompletedCart *cart.Cart
}

CompleteCartRollbackData for later rollbacks

type CompletePayment

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

CompletePayment state

func (*CompletePayment) Inject

func (c *CompletePayment) Inject(
	paymentService *application.PaymentService,
) *CompletePayment

Inject dependencies

func (CompletePayment) IsFinal

func (c CompletePayment) IsFinal() bool

IsFinal if state is a final state

func (CompletePayment) Name

func (CompletePayment) Name() string

Name get state name

func (CompletePayment) Rollback

Rollback the state operations

func (CompletePayment) Run

Run the state operations

type CreatePayment

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

CreatePayment state

func (*CreatePayment) Inject

func (c *CreatePayment) Inject(
	paymentService *application.PaymentService,
) *CreatePayment

Inject dependencies

func (CreatePayment) IsFinal

func (c CreatePayment) IsFinal() bool

IsFinal if state is a final state

func (CreatePayment) Name

func (CreatePayment) Name() string

Name get state name

func (CreatePayment) Rollback

func (c CreatePayment) Rollback(ctx context.Context, data process.RollbackData) error

Rollback the state operations

func (CreatePayment) Run

Run the state operations

type CreatePaymentRollbackData

type CreatePaymentRollbackData struct {
	PaymentID string
	Gateway   string
}

CreatePaymentRollbackData needed for rollback

type Failed

type Failed struct {
	Reason process.FailedReason
}

Failed state

func (Failed) IsFinal

func (f Failed) IsFinal() bool

IsFinal if state is a final state

func (Failed) Name

func (f Failed) Name() string

Name get state name

func (Failed) Rollback

func (f Failed) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (Failed) Run

Run the state operations

type FormField

type FormField struct {
	Value []string
}

FormField represents a form field to be displayed to the user

type New

type New struct {
}

New state

func (New) IsFinal

func (n New) IsFinal() bool

IsFinal if state is a final state

func (New) Name

func (New) Name() string

Name get state name

func (New) Rollback

func (n New) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (New) Run

Run the state operations

type PlaceOrder

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

PlaceOrder state

func (*PlaceOrder) Inject

func (po *PlaceOrder) Inject(
	orderService *application.OrderService,
	cartService *cartApplication.CartService,
	cartDecoratorFactory *decorator.DecoratedCartFactory,
	paymentService *paymentApplication.PaymentService,
) *PlaceOrder

Inject dependencies

func (PlaceOrder) IsFinal

func (po PlaceOrder) IsFinal() bool

IsFinal if state is a final state

func (PlaceOrder) Name

func (PlaceOrder) Name() string

Name get state name

func (PlaceOrder) Rollback

func (po PlaceOrder) Rollback(ctx context.Context, data process.RollbackData) error

Rollback the state operations

func (PlaceOrder) Run

Run the state operations

type PlaceOrderRollbackData

type PlaceOrderRollbackData struct {
	OrderInfos application.PlaceOrderInfo
}

PlaceOrderRollbackData needed for rollbacks

type PostRedirect

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

PostRedirect state

func (*PostRedirect) Inject

func (pr *PostRedirect) Inject(
	paymentService *application.PaymentService,
	validator process.PaymentValidatorFunc,
) *PostRedirect

Inject dependencies

func (PostRedirect) IsFinal

func (pr PostRedirect) IsFinal() bool

IsFinal if state is a final state

func (PostRedirect) Name

func (PostRedirect) Name() string

Name get state name

func (PostRedirect) Rollback

func (pr PostRedirect) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (PostRedirect) Run

Run the state operations

type PostRedirectData

type PostRedirectData struct {
	FormFields map[string]FormField
	URL        *url.URL
}

PostRedirectData holds details regarding the redirect

type PrepareCart

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

PrepareCart state

func (*PrepareCart) Inject

func (v *PrepareCart) Inject(
	cartService *application.CartService,
) *PrepareCart

Inject dependencies

func (PrepareCart) IsFinal

func (v PrepareCart) IsFinal() bool

IsFinal if state is a final state

func (PrepareCart) Name

func (PrepareCart) Name() string

Name get state name

func (PrepareCart) Rollback

Rollback the state operations

func (PrepareCart) Run

Run the state operations

type Redirect

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

Redirect state

func (*Redirect) Inject

func (r *Redirect) Inject(
	paymentService *application.PaymentService,
	validator process.PaymentValidatorFunc,
) *Redirect

Inject dependencies

func (Redirect) IsFinal

func (r Redirect) IsFinal() bool

IsFinal if state is a final state

func (Redirect) Name

func (Redirect) Name() string

Name get state name

func (Redirect) Rollback

func (r Redirect) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (Redirect) Run

Run the state operations

type ShowHTML

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

ShowHTML state

func (*ShowHTML) Inject

func (sh *ShowHTML) Inject(
	paymentService *application.PaymentService,
	validator process.PaymentValidatorFunc,
) *ShowHTML

Inject dependencies

func (ShowHTML) IsFinal

func (sh ShowHTML) IsFinal() bool

IsFinal if state is a final state

func (ShowHTML) Name

func (ShowHTML) Name() string

Name get state name

func (ShowHTML) Rollback

func (sh ShowHTML) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (ShowHTML) Run

Run the state operations

type ShowIframe

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

ShowIframe state

func (*ShowIframe) Inject

func (si *ShowIframe) Inject(
	paymentService *application.PaymentService,
	validator process.PaymentValidatorFunc,
) *ShowIframe

Inject dependencies

func (ShowIframe) IsFinal

func (si ShowIframe) IsFinal() bool

IsFinal if state is a final state

func (ShowIframe) Name

func (ShowIframe) Name() string

Name get state name

func (ShowIframe) Rollback

func (si ShowIframe) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (ShowIframe) Run

Run the state operations

type ShowWalletPayment

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

ShowWalletPayment state

func (*ShowWalletPayment) Inject

Inject dependencies

func (ShowWalletPayment) IsFinal

func (pr ShowWalletPayment) IsFinal() bool

IsFinal if state is a final state

func (ShowWalletPayment) Name

func (ShowWalletPayment) Name() string

Name get state name

func (ShowWalletPayment) Rollback

Rollback the state operations

func (ShowWalletPayment) Run

Run the state operations

type ShowWalletPaymentData

type ShowWalletPaymentData domain.WalletDetails

ShowWalletPaymentData holds details regarding the wallet payment

type Success

type Success struct{}

Success state

func (Success) IsFinal

func (s Success) IsFinal() bool

IsFinal if state is a final state

func (Success) Name

func (s Success) Name() string

Name get state name

func (Success) Rollback

func (s Success) Rollback(ctx context.Context, _ process.RollbackData) error

Rollback the state operations

func (Success) Run

Run the state operations

type ValidateCart

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

ValidateCart state

func (*ValidateCart) Inject

func (v *ValidateCart) Inject(
	cartService *application.CartService,
) *ValidateCart

Inject dependencies

func (ValidateCart) IsFinal

func (v ValidateCart) IsFinal() bool

IsFinal if state is a final state

func (ValidateCart) Name

func (ValidateCart) Name() string

Name get state name

func (ValidateCart) Rollback

Rollback the state operations

func (ValidateCart) Run

Run the state operations

type ValidatePayment

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

ValidatePayment state

func (*ValidatePayment) Inject

func (v *ValidatePayment) Inject(
	paymentService *application.PaymentService,
	validator process.PaymentValidatorFunc,
) *ValidatePayment

Inject dependencies

func (ValidatePayment) IsFinal

func (v ValidatePayment) IsFinal() bool

IsFinal if state is a final state

func (ValidatePayment) Name

func (ValidatePayment) Name() string

Name get state name

func (ValidatePayment) Rollback

Rollback the state operations

func (ValidatePayment) Run

Run the state operations

type ValidatePaymentSelection

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

ValidatePaymentSelection state

func (*ValidatePaymentSelection) Inject

func (v *ValidatePaymentSelection) Inject(
	cartDecoratorFactory *decorator.DecoratedCartFactory,
	opts *struct {
		Validator validation.PaymentSelectionValidator `inject:",optional"`
	},
) *ValidatePaymentSelection

Inject dependencies

func (ValidatePaymentSelection) IsFinal

func (v ValidatePaymentSelection) IsFinal() bool

IsFinal if state is a final state

func (ValidatePaymentSelection) Name

Name get state name

func (ValidatePaymentSelection) Rollback

Rollback the state operations

func (ValidatePaymentSelection) Run

Run the state operations

type WaitForCustomer

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

WaitForCustomer state

func (*WaitForCustomer) Inject

func (wc *WaitForCustomer) Inject(
	paymentService *application.PaymentService,
	validator process.PaymentValidatorFunc,
) *WaitForCustomer

Inject dependencies

func (WaitForCustomer) IsFinal

func (wc WaitForCustomer) IsFinal() bool

IsFinal if state is a final state

func (WaitForCustomer) Name

func (WaitForCustomer) Name() string

Name get state name

func (WaitForCustomer) Rollback

Rollback the state operations

func (WaitForCustomer) Run

Run the state operations

Jump to

Keyboard shortcuts

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