Documentation ¶
Index ¶
- func RegisterRoutes(h *Handler, router *anor.Router)
- type ConfirmationTokenRequest
- type CreatePaymentIntentResponse
- type Handler
- func (h *Handler) AddressView(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ConfirmView(w http.ResponseWriter, r *http.Request)
- func (h *Handler) CreatePaymentIntent(w http.ResponseWriter, r *http.Request)
- func (h *Handler) PaymentMethodView(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Render(w http.ResponseWriter, r *http.Request, templatePath string, ...)
- func (h *Handler) RetrieveOrderSummary(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SaveStripeConfirmationToken(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetOrderAddress(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SuccessView(w http.ResponseWriter, r *http.Request)
- type HandlerConfig
- type SetOrderAddressForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
RegisterRoutes sets up the routing for the checkout-related endpoints. It maps HTTP methods and paths to their respective handler functions.
Types ¶
type ConfirmationTokenRequest ¶
type ConfirmationTokenRequest struct {
ConfirmationTokenID string `json:"confirmation_token_id"`
}
func (*ConfirmationTokenRequest) Bind ¶
func (req *ConfirmationTokenRequest) Bind(r *http.Request) error
func (*ConfirmationTokenRequest) Validate ¶
func (req *ConfirmationTokenRequest) Validate() error
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler manages HTTP requests for checkout operations.
func NewHandler ¶
func NewHandler(cfg HandlerConfig) *Handler
NewHandler creates and returns a new Handler instance.
func (*Handler) AddressView ¶
func (h *Handler) AddressView(w http.ResponseWriter, r *http.Request)
func (*Handler) ConfirmView ¶
func (h *Handler) ConfirmView(w http.ResponseWriter, r *http.Request)
func (*Handler) CreatePaymentIntent ¶
func (h *Handler) CreatePaymentIntent(w http.ResponseWriter, r *http.Request)
func (*Handler) PaymentMethodView ¶
func (h *Handler) PaymentMethodView(w http.ResponseWriter, r *http.Request)
func (*Handler) Render ¶
func (h *Handler) Render(w http.ResponseWriter, r *http.Request, templatePath string, td templates.TemplateData)
func (*Handler) RetrieveOrderSummary ¶
func (h *Handler) RetrieveOrderSummary(w http.ResponseWriter, r *http.Request)
func (*Handler) SaveStripeConfirmationToken ¶
func (h *Handler) SaveStripeConfirmationToken(w http.ResponseWriter, r *http.Request)
func (*Handler) SetOrderAddress ¶
func (h *Handler) SetOrderAddress(w http.ResponseWriter, r *http.Request)
func (*Handler) SuccessView ¶
func (h *Handler) SuccessView(w http.ResponseWriter, r *http.Request)
type HandlerConfig ¶
type HandlerConfig struct { UserService anor.UserService CartService anor.CartService StripePaymentService anor.StripePaymentService OrderService anor.OrderService CategorySvc anor.CategoryService AddressService anor.AddressService View *html.View SessionManager *session.Manager Logger *slog.Logger Config *config.Config }
HandlerConfig contains the dependencies for creating a new Handler.
type SetOrderAddressForm ¶
func (*SetOrderAddressForm) Validate ¶
func (f *SetOrderAddressForm) Validate() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.