Shopifex v1.0.1 Shopifex.Plug.PaymentGuard View Source

Add payment guards to your routes or controllers!

Examples:

defmodule MyAppWeb.AdminLinkController do
  use MyAppWeb, :controller
  require Logger

  plug Shopifex.Plug.PaymentGuard, "premium_plan" when action in [:premium_function]

  def premium_function(conn, _params) do
    # Wow, much premium.
    conn
    |> send_resp(200, "success")
  end
end

Link to this section Summary

Functions

This makes sure the shop in the session contains a payment which unlocks the guard

Link to this section Functions

Link to this function

call(conn, guard_identifier)

View Source

This makes sure the shop in the session contains a payment which unlocks the guard