lib/requests/payments/three_d_s/stand_alone.ex
defmodule Requests.Payments.ThreeDS.StandAlone do
@type t :: %__MODULE__{
enabled: true | false,
authentication_id: String.t(),
type: String.t()
}
@enforce_keys [:type]
defstruct [:authentication_id, :enabled, :type]
def build(%{type: "standalone"} = params) when is_map(params) do
%{
enabled: params[:enabled],
authentication_id: params[:authentication_id]
}
end
def build(_), do: nil
end