# `MPP.Client.AcceptPolicy`
[🔗](https://github.com/ZenHive/mpp/blob/v0.10.0/lib/mpp/client/accept_policy.ex#L1)

Gates `Accept-Payment` header injection on outgoing HTTP requests.

Without a gate, a global payment middleware advertises supported payment
methods on every cross-origin request, which can break CORS preflight and
leak wallet capabilities.

Defaults to `:always` for backwards compatibility (matches mpp-rs
`AcceptPaymentPolicy::Always`).

## API Functions
| Function | Arity | Description | Param Kinds |
| --- | --- | --- | --- |
| `default` | 0 | Return the default policy (`:always`). | - |
| `allows?` | 2 | Return true if `Accept-Payment` injection is permitted for `url`. | `policy: value`, `url: value` |

# `t`

```elixir
@type t() :: :always | :never | {:same_origin, String.t()} | {:origins, [String.t()]}
```

# `allows?`

```elixir
@spec allows?(t(), String.t() | URI.t()) :: boolean()
```

Return `true` if `Accept-Payment` header injection is permitted for `url`.

# `default`

```elixir
@spec default() :: t()
```

Return the default policy (`:always`).

---

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