StripeElixir.Services.SourceService (stripe_elixir v0.1.0)

Copy Markdown View Source

Source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

Related guides: Sources API and Sources & Customers.

Summary

Functions

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

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

Shares a source

Creates a new source object.

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

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

Retrieve a source

Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.

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

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

Update a source

Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.

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

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

Verify a given source.