# `OpenPayments.Types.ILPPaymentMethod`
[🔗](https://github.com/interledger/open-payments-elixir/blob/v1.0.0/lib/open_payments/types/ilp_payment_method.ex#L1)

ILP connection details returned in an incoming payment's `methods` array.

`from_map/1` validates the pinned `ilp-payment-method` schema: type `ilp`, an
ILP address of at most 1023 characters, a nonempty unpadded base64url-alphabet
shared secret, and no additional fields. It does not decode the secret, impose
a secret byte length, or establish a STREAM connection.

Inspection omits `shared_secret`. Explicit `to_map/1` and JSON encoding include
the secret because it is part of the protocol payload; treat those exports as
sensitive. Errors identify fields without retaining rejected values.

Struct literals can bypass validation. Call `validate/1` after constructing or
modifying a struct; `to_map/1` converts its shape without validating it.

# `t`

```elixir
@type t() :: %OpenPayments.Types.ILPPaymentMethod{
  ilp_address: String.t(),
  shared_secret: String.t(),
  type: String.t()
}
```

# `from_map`

```elixir
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
```

Decodes and validates an ILP payment-method JSON object.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts to protocol fields, including the shared secret, without validating.

# `validate`

```elixir
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
```

Validates a payment-method struct against the shared ILP schema.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
