Current section
Files
Jump to
Current section
Files
lib/rapyd/types/shared.ex
defmodule Rapyd.Types.Address do
@moduledoc "Physical address used across multiple Rapyd domains."
@type t :: %__MODULE__{
id: String.t() | nil,
name: String.t() | nil,
line_1: String.t() | nil,
line_2: String.t() | nil,
line_3: String.t() | nil,
city: String.t() | nil,
state: String.t() | nil,
country: String.t() | nil,
zip: String.t() | nil,
phone_number: String.t() | nil,
canton: String.t() | nil,
district: String.t() | nil,
metadata: map() | nil
}
defstruct [
:id,
:name,
:line_1,
:line_2,
:line_3,
:city,
:state,
:country,
:zip,
:phone_number,
:canton,
:district,
:metadata
]
end
defmodule Rapyd.Types.EWalletSplit do
@moduledoc "One wallet's share in a split or group payment."
@type t :: %__MODULE__{
ewallet: String.t(),
amount: float() | nil,
percentage: float() | nil
}
defstruct [:ewallet, :amount, :percentage]
end
defmodule Rapyd.Types.Fee do
@moduledoc "A single fee rule (percentage or absolute) applied to a payment."
@type t :: %__MODULE__{
calc_type: String.t(),
fee_type: String.t(),
value: float()
}
defstruct [:calc_type, :fee_type, :value]
end
defmodule Rapyd.Types.PaymentFees do
@moduledoc "Transaction and FX fee configuration for a payment."
@type t :: %__MODULE__{
transaction_fee: Rapyd.Types.Fee.t() | nil,
fx_fee: Rapyd.Types.Fee.t() | nil
}
defstruct [:transaction_fee, :fx_fee]
end
defmodule Rapyd.Types.FXRate do
@moduledoc "Foreign-exchange rate returned by the Get FX Rate endpoint."
@type t :: %__MODULE__{
buy_currency: String.t(),
sell_currency: String.t(),
fixed_side: String.t() | nil,
buy_rate: float(),
sell_rate: float(),
expiry: integer()
}
defstruct [:buy_currency, :sell_currency, :fixed_side, :buy_rate, :sell_rate, :expiry]
end
defmodule Rapyd.Types.Pagination do
@moduledoc "Cursor-based pagination parameters for list endpoints."
@type t :: %__MODULE__{
starting_after: String.t() | nil,
ending_before: String.t() | nil,
limit: non_neg_integer() | nil
}
defstruct [:starting_after, :ending_before, :limit]
end