Shopifex v0.6.1 ShopifexWeb.PaymentController behaviour View Source

You can use this module inside of another controller to handle initial iFrame load and shop installation

Example:

mix phx.gen.html Shops Plan plans name:string price:string features:array grants:array test:boolean mix phx.gen.html Shops Grant grants shop:references:shops charge_id:integer grants:array

defmodule MyAppWeb.PaymentController do
  use MyAppWeb, :controller
  use ShopifexWeb.PaymentController

  # Thats it! You can now configure your purchasable products :)
end

Link to this section Summary

Callbacks

An optional callback called after a payment is completed. By default, this function redirects the user to the app index within their Shopify admin panel.

Link to this section Callbacks

Link to this callback

after_payment(arg1, arg2, arg3, arg4, arg5)

View Source (optional)

Specs

An optional callback called after a payment is completed. By default, this function redirects the user to the app index within their Shopify admin panel.

Example

def after_payment(conn, shop, plan, grant, redirect_after) do
  # send yourself an e-mail about payment

  # follow default behaviour.
  super(conn, shop, plan, grant, redirect_after)
end