Search documentation of stripe_elixir

# StripeElixir.Services.Checkout.SessionService (stripe_elixir v0.1.0)

Copy Markdown View Source

Session

A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout or Payment Links. We recommend creating a new Session each time your customer attempts to pay.

Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentIntent or an active Subscription.

You can create a Checkout Session on your server and redirect to its URL to begin Checkout.

Related guide: Checkout quickstart

## Summary

### Functions

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

Create a Checkout Session

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

Expire a Checkout Session

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

List all Checkout Sessions

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

Retrieve a Checkout Session

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

Update a Checkout Session

## Functions

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

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

Create a Checkout Session

Creates a Checkout Session object.

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

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

Expire a Checkout Session

A Checkout Session can be expired when it is in one of these statuses: `open`

After it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.

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

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

List all Checkout Sessions

Returns a list of Checkout Sessions.

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

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

Retrieve a Checkout Session

Retrieves a Checkout Session object.

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

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

Update a Checkout Session

Updates a Checkout Session object.

Related guide: Dynamically update a Checkout Session