Marqeta.AutoReload (marqeta v1.0.0)

Copy Markdown View Source

Automatically reload a user's GPA when the balance falls below a threshold.

Examples

{:ok, ar} = Marqeta.AutoReload.create(%{
  funding_source_token: "fs_01",
  currency_code: "USD",
  active: true,
  order_scope: %{
    gpa: %{
      reload_threshold: 10.00,
      reload_amount: 100.00
    }
  },
  association: %{user_token: "user_01"}
})

Summary

Functions

Creates a new auto reload.

Creates a new auto reload. Raises Marqeta.Error on failure.

Retrieves a auto reload by token.

Retrieves a auto reload by token. Raises Marqeta.Error on failure.

Lists auto reload resources.

Lists auto reload resources. Raises Marqeta.Error on failure.

Lists auto reload configurations for a business.

Lists auto reload configurations for a card product.

Lists auto reload configurations for a user.

Returns a lazy Stream that auto-paginates auto reload resources.

Updates an existing auto reload.

Updates an existing auto reload. Raises Marqeta.Error on failure.

Functions

create(params \\ %{}, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Creates a new auto reload.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

create!(params \\ %{}, opts \\ [])

@spec create!(
  map(),
  keyword()
) :: map()

Creates a new auto reload. Raises Marqeta.Error on failure.

get(token, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Retrieves a auto reload by token.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

get!(token, opts \\ [])

@spec get!(
  String.t(),
  keyword()
) :: map()

Retrieves a auto reload by token. Raises Marqeta.Error on failure.

list(params \\ %{}, opts \\ [])

@spec list(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Lists auto reload resources.

Accepts standard Marqeta pagination params: count, start_index, sort_by, sort_order, fields.

Use stream/2 to lazily iterate all pages automatically.

list!(params \\ %{}, opts \\ [])

@spec list!(
  map(),
  keyword()
) :: map()

Lists auto reload resources. Raises Marqeta.Error on failure.

list_by_business(token, params \\ %{}, opts \\ [])

@spec list_by_business(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Lists auto reload configurations for a business.

list_by_card_product(token, params \\ %{}, opts \\ [])

@spec list_by_card_product(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Lists auto reload configurations for a card product.

list_by_user(user_token, params \\ %{}, opts \\ [])

@spec list_by_user(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Lists auto reload configurations for a user.

stream(params \\ %{}, opts \\ [])

@spec stream(
  map(),
  keyword()
) :: Enumerable.t()

Returns a lazy Stream that auto-paginates auto reload resources.

update(token, params, opts \\ [])

@spec update(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Updates an existing auto reload.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

update!(token, params, opts \\ [])

@spec update!(String.t(), map(), keyword()) :: map()

Updates an existing auto reload. Raises Marqeta.Error on failure.