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
