Current section

Files

Jump to
wallet_passes lib wallet_passes pass_data_provider.ex
Raw

lib/wallet_passes/pass_data_provider.ex

defmodule WalletPasses.PassDataProvider do
@moduledoc """
Behaviour for consumers to implement pass data lookups.
The library calls this when it needs to autonomously build pass content,
e.g. when Apple requests an updated pass via the callback router.
"""
@type pass_bundle :: %{
pass_data: WalletPasses.PassData.t(),
apple: WalletPasses.Apple.Visual.t() | nil,
google: WalletPasses.Google.Visual.t() | nil,
}
@callback build_pass_data(serial_number :: String.t()) ::
{:ok, pass_bundle()} | {:error, term()}
end