# `MishkaPay.Ash.Owner`
[🔗](https://github.com/mishka-group/mishka_pay/blob/v0.0.1/lib/mishka_pay/ash/__helpers/owner.ex#L6)

How a payment or a subscription row finds its user (`belongs_to_user` of
`MishkaPay.Ash.Resource`).

`:start_checkout` names the actor as the checkout's `:owner` (`MishkaPay.Checkout`), unless the
checkout names one itself. The provider keeps the owner on the payment or the subscription, so
every sync, from an action or a webhook, writes it into the user attribute again: the
provider's word, like every other synced field. An owner that is not a user id of the host
leaves the attribute empty.

# `into`

```elixir
@spec into(map(), term()) :: map()
```

`attrs` (a checkout map) with the actor's primary key as its `:owner`, unless they name one or
there is no actor.

# `write`

```elixir
@spec write(Ash.Changeset.t(), String.t() | nil) :: Ash.Changeset.t()
```

The changeset with `owner` in the resource's user attribute, cast to its type; empty when the
resource has no `belongs_to_user`, or when `owner` is not a value of that type.

---

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