Search documentation of stripe_elixir

# StripeElixir.Services.TopupService (stripe_elixir v0.1.0)

Copy Markdown View Source

Topup

To top up your Stripe balance, you create a top-up object. You can retrieve individual top-ups, as well as list all top-ups. Top-ups are identified by a unique, random ID.

Related guide: Topping up your platform account

## Summary

### Functions

cancel(client, topup, params \\ %{}, opts \\ [])

Cancel a top-up

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

Create a top-up

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

List all top-ups

retrieve(client, topup, params \\ %{}, opts \\ [])

Retrieve a top-up

update(client, topup, params \\ %{}, opts \\ [])

Update a top-up

## Functions

# cancel(client, topup, params \\ %{}, opts \\ [])

    @spec cancel(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Cancel a top-up

Cancels a top-up. Only pending top-ups can be canceled.

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

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

Create a top-up

Top up the balance of an account

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

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

List all top-ups

Returns a list of top-ups.

# retrieve(client, topup, params \\ %{}, opts \\ [])

    @spec retrieve(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Retrieve a top-up

Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.

# update(client, topup, params \\ %{}, opts \\ [])

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

Update a top-up

Updates the metadata of a top-up. Other top-up details are not editable by design.