MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / listPlansHandler

Method listPlansHandler

internal/payment/shop.go:128–137  ·  view source on GitHub ↗
(mode string)

Source from the content-addressed store, hash-verified

126}
127
128func (s *ShopAPI) listPlansHandler(mode string) http.HandlerFunc {
129 return func(w http.ResponseWriter, r *http.Request) {
130 list, err := s.PlanStore.ListEnabledPlansByMode(mode)
131 if err != nil {
132 writeJSONError(w, http.StatusInternalServerError, "failed to list plans")
133 return
134 }
135 writeJSON(w, http.StatusOK, map[string]any{"plans": list})
136 }
137}
138
139func (s *ShopAPI) createCheckoutHandler(mode, shopPath string) http.HandlerFunc {
140 return func(w http.ResponseWriter, r *http.Request) {

Callers 1

RegisterMethod · 0.95

Calls 3

writeJSONErrorFunction · 0.85
writeJSONFunction · 0.70

Tested by

no test coverage detected