# `X402.Extensions.PaymentIdentifier.RedisCache.Command`
[🔗](https://github.com/cardotrejos/x402/blob/v0.9.0/lib/x402/extensions/payment_identifier/redis_cache.ex#L1)

Behaviour for the Redis command layer used by
`X402.Extensions.PaymentIdentifier.RedisCache`.

The single callback mirrors `Redix.command/2`: it executes one Redis
command against a connection and returns the reply. `Redix` itself
satisfies the behaviour structurally and is the default; tests (or
alternative Redis clients with a compatible reply shape) can supply their
own module through the adapter's `:command` option.

# `command`

```elixir
@callback command(conn :: term(), command :: [String.t()]) ::
  {:ok, term()} | {:error, term()}
```

Executes a single Redis command against `conn`.

Must follow `Redix.command/2` semantics: `{:ok, reply}` with the decoded
RESP reply (`"OK"`, `nil`, a binary, or an integer for the commands this
adapter issues), or `{:error, reason}` for connection or protocol errors.

---

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