Paypal.Common.CurrencyValue (Paypal v0.1.1)

View Source

Most of the currencies in the Paypal requests and responses are handled as a JSON object that is including currency_code and value. But it's even more complex in other requests.

This struct contains the possibilities for all of these requests/responses.

Summary

Types

t()

The type is composed by the following

Types

t()

@type t() :: %Paypal.Common.CurrencyValue{
  breakdown: map() | nil,
  currency_code: String.t() | nil,
  value: Decimal.t() | nil
}

The type is composed by the following:

  • currency_code is the currency code based on ISO-4217, i.e. EUR
  • value is the decimal or integer value for the currency.
  • breakdown is expressing information for the money.

About the breakdown, we could find that if it's provided, it could include information like this one:

%{
  "item_total" => %{
    "currency_code" => "EUR",
    "value" => "12.00"
  },
  "shipping" => %{
    "currency_code" => "EUR",
    "value" => "2.00"
  },
  "discount" => {
    "currency_code" => "EUR",
    "value" => "5.00"
  }
}