berrypod/lib/berrypod/payments/registry.ex
jamey c2caeed64d add setup onboarding page, dashboard launch checklist, provider registry
- new /setup page with three-section onboarding (account, provider, payments)
- dashboard launch checklist with progress bar, go-live, dismiss
- provider registry on Provider module (single source of truth for metadata)
- payments registry for Stripe
- setup context made provider-agnostic (provider_connected, theme_customised, etc.)
- admin provider pages now fully registry-driven (no hardcoded provider names)
- auth flow: fresh installs redirect to /setup, signed_in_path respects setup state
- removed old /admin/setup wizard
- 840 tests, 0 failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:34:06 +00:00

29 lines
836 B
Elixir

defmodule Berrypod.Payments.Registry do
@moduledoc """
Payment provider metadata registry.
Lightweight — just Stripe for now. No behaviour abstraction until
a second payment provider justifies one.
"""
@providers [
%{
type: "stripe",
name: "Stripe",
tagline: "Accept cards, Apple Pay, Google Pay and more",
setup_hint: "Find your secret key under Developers → API keys",
setup_url: "https://dashboard.stripe.com/apikeys",
status: :available
}
]
@doc "Returns all payment providers."
def all, do: @providers
@doc "Returns only providers with `:available` status."
def available, do: Enum.filter(@providers, &(&1.status == :available))
@doc "Returns a payment provider by type string, or nil."
def get(type), do: Enum.find(@providers, &(&1.type == type))
end