Checks one site's setup before it takes money, the way a deploy or CI step would: each check is
{name, :ok | {:error, reason}}, in order, and run/1 never raises. mix mishka_pay.check
prints them.
MishkaPay.Check.run(provider: "stripe", tenant: site.id,
webhook_url: "https://shop.test/pay/webhooks/stripe/#{site.id}", domain: MyApp.Pay)What it checks:
:provider: the provider is installed and offered (MishkaPay.Provider.fetch/1);:keys: the site's keys plugin answers keys for it (MishkaPay.Credentials);:keys_accepted: the provider takes the keys, with one read call (MishkaPay.Providercheck_keys/1, when the provider has it);:webhook_secret: the keys carry the secret webhooks are checked with;:webhook_endpoint: withwebhook_url:, the provider sends every event Mishka Pay acts on to it (Stripe:MishkaPay.Providers.Stripe.WebhookEndpoint);:listeners: withdomain:(an Ash domain), each of its Mishka Pay listeners is started;:inbox: withdomain:, it has an:inboxresource, and Oban runs its queue.
Summary
Functions
Whether every check of results passed.
Runs every check that applies to opts, and answers them in order.