Worldpay.Schema.Amount (Worldpay v1.0.0)

Copy Markdown View Source

Monetary amount with currency.

Summary

Functions

Build from a string-keyed or atom-keyed map.

Serialize to a string-keyed map.

Types

t()

@type t() :: %Worldpay.Schema.Amount{currency: String.t(), value: non_neg_integer()}

Functions

from_map(map)

@spec from_map(%{required(String.t()) => term()} | %{required(atom()) => term()}) ::
  t()

Build from a string-keyed or atom-keyed map.

to_map(amount)

@spec to_map(t()) :: %{required(String.t()) => term()}

Serialize to a string-keyed map.