How the Ash layer finds the tenant a provider call is for (MishkaPay.Credentials), so it
works the same in a single-site project and in a multi-tenant one like Mishka CMS.
A Mishka Pay resource may carry Ash multitenancy on the host's own attribute:
multitenancy do
strategy :attribute
attribute :site_id
endIts actions then run with the site as Ash's tenant (tenant: site.id), and that tenant is the
one the provider's keys are read for; the listeners sync each webhook's row inside the
webhook's own tenant (/pay/webhooks/stripe/<site id>). Without multitenancy the :tenant
argument says it. The row keeps it in its :tenant attribute either way, so later actions
(refund, cancel, edit) use the same keys. The webhook inbox stays global: a webhook arrives
before any tenant is chosen.
Summary
Functions
attrs (a call's map) with tenant when they name none, so an action run in a site's Ash tenant
calls the provider with that site's keys.
The tenant of an action: a create's :tenant argument, else Ash's tenant; a generic action's
(:start_checkout) is Ash's tenant.
The Ash options a listener syncs resource with, for an event of tenant.
Functions
attrs (a call's map) with tenant when they name none, so an action run in a site's Ash tenant
calls the provider with that site's keys.
@spec of(Ash.Changeset.t() | Ash.ActionInput.t()) :: String.t() | nil
The tenant of an action: a create's :tenant argument, else Ash's tenant; a generic action's
(:start_checkout) is Ash's tenant.
The Ash options a listener syncs resource with, for an event of tenant.