(mode string)
| 126 | } |
| 127 | |
| 128 | func (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 | |
| 139 | func (s *ShopAPI) createCheckoutHandler(mode, shopPath string) http.HandlerFunc { |
| 140 | return func(w http.ResponseWriter, r *http.Request) { |
no test coverage detected