Shopifex.Plug.ShopifyWebhook (Shopifex v3.0.0)

Copy Markdown View Source

Authenticates a Shopify request and builds the Shopifex session.

Two modes, chosen with the :mode plug option:

  • :webhook (default) — a webhook POST. The x-shopify-hmac-sha256 header is verified against the HMAC of the raw request body (see Shopifex.Plug.valid_webhook_hmac?/1). The shop is resolved from the x-shopify-shop-domain header or the verified body — never from a query/body param a caller can choose, and a query-string hmac is ignored.
  • :admin_link — an admin-link / bulk-action-link GET, signed like an app load. The query hmac is verified and, when a timestamp is present, its freshness is checked. The shop is resolved from the signed query shop param.

The :shopify_webhook and :shopify_admin_link pipelines set the mode.

Summary

Functions

call(conn, options)

init(options)