forms

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckoutFormComposite

type CheckoutFormComposite struct {
	// BillingAddressForm - the processed Form object for the BillingAddressForm
	// incoming form values are expected with namespace "billingAddress"
	BillingAddressForm *domain.Form
	// DeliveryForms - the processed Form object for the DeliveryForms
	// incoming form values are expected with namespace "deliveries.###DELIVERYCODE###"
	DeliveryForms map[string]*domain.Form
	// SimplePaymentForm - the processed Form object for the SimplePaymentForm
	// incoming form values are expected with namespace "payment"
	SimplePaymentForm *domain.Form
	// PersonalDataForm - the processed Form object for personal data
	PersonalDataForm *domain.Form
}

CheckoutFormComposite - a complete form (composite) for collecting all checkout data

func (*CheckoutFormComposite) GetAllGeneralErrors

func (c *CheckoutFormComposite) GetAllGeneralErrors() []domain.Error

GetAllGeneralErrors from the included forms

func (*CheckoutFormComposite) HasAnyGeneralErrors

func (c *CheckoutFormComposite) HasAnyGeneralErrors() bool

HasAnyGeneralErrors checks if any from the included forms has general errors

type CheckoutFormController

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

CheckoutFormController - the (mini) MVC for the complete checkout form

func (*CheckoutFormController) GetUnsubmittedForm

func (c *CheckoutFormController) GetUnsubmittedForm(ctx context.Context, r *web.Request) (*CheckoutFormComposite, error)

GetUnsubmittedForm returns the form

func (*CheckoutFormController) HandleFormAction

HandleFormAction handles the submitted form request

func (*CheckoutFormController) Inject

func (c *CheckoutFormController) Inject(responder *web.Responder,
	applicationCartService *cartApplication.CartService,
	applicationCartReceiverService *cartApplication.CartReceiverService,
	logger flamingo.Logger,
	formHandlerFactory application.FormHandlerFactory,
	billingAddressFormController *cartInterfaceForms.BillingAddressFormController,
	deliveryFormController *cartInterfaceForms.DeliveryFormController,
	simplePaymentFormController *cartInterfaceForms.SimplePaymentFormController,
	personalDataFormController *cartInterfaceForms.PersonalDataFormController,
	config *struct {
		UseDeliveryForms    bool `inject:"config:commerce.checkout.useDeliveryForms"`
		UsePersonalDataForm bool `inject:"config:commerce.checkout.usePersonalDataForm"`
	},
)

Inject dependencies

Jump to

Keyboard shortcuts

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