Packages

A Simple LIB to use the Checkout.com API

Current section

Files

Jump to
checkout_sdk lib responses void_payment.ex
Raw

lib/responses/void_payment.ex

defmodule Responses.VoidPayment do
@moduledoc false
@derive Jason.Encoder
defstruct [:links, :action_id]
def build(%{"_links" => links, "action_id" => action_id}) do
%__MODULE__{
links: build_link(links),
action_id: action_id
}
end
defp build_link(%{"payment" => %{"href" => href}}) do
%{payment: %{href: href}}
end
end