Search documentation of tiger_stripe

# Stripe.Services.SourceService (tiger_stripe v0.1.1)

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 \\ [])

Shares a source

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

Retrieve a source

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

Update a source

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

Verify a given source.

## Functions

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

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

Shares a source

Creates a new source object.

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

    @spec retrieve(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.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(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.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(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

Verify a given source.