defmodule UpiStatic do @moduledoc """ UpiStatic is the Static QR PSP Phoenix application. Handles all UPI flows where initiationMode = 02 or 15 (static QR). Uses orgId: MER102, netInstId: MER1020002. Implements NPCI UPI APIs: - ReqValQr — QR validation (static QR lookup by tr/tn) - ReqPay — payment processing (static QR transactions) - ReqChkTxn — transaction status check - ReqHbt — heartbeat """ def static_paths, do: ~w(assets fonts images favicon.ico robots.txt) def router do quote do use Phoenix.Router, helpers: false import Plug.Conn import Phoenix.Controller end end def channel do quote do use Phoenix.Channel end end def controller do quote do use Phoenix.Controller, formats: [:html, :json], layouts: [html: UpiStatic.Layouts] use Gettext, backend: UpiStatic.Gettext import Plug.Conn unquote(verified_routes()) end end defp verified_routes do quote do use Phoenix.VerifiedRoutes, endpoint: UpiStatic.Endpoint, router: UpiStatic.Router, statics: UpiStatic.static_paths() end end defmacro __using__(which) when is_atom(which) do apply(__MODULE__, which, []) end end