View Source Stripe.CustomerSession (stripity_stripe v3.2.0)
A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) control over a customer.
Summary
Types
Configuration for buy button.
Configuration for each component. 1 component must be enabled.
Configuration for the pricing table.
The customer_session type.
Functions
Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Types
@type buy_button() :: %{optional(:enabled) => boolean()}
Configuration for buy button.
@type components() :: %{ optional(:buy_button) => buy_button(), optional(:pricing_table) => pricing_table() }
Configuration for each component. 1 component must be enabled.
@type pricing_table() :: %{optional(:enabled) => boolean()}
Configuration for the pricing table.
@type t() :: %Stripe.CustomerSession{ client_secret: binary(), components: term(), created: integer(), customer: binary() | Stripe.Customer.t(), expires_at: integer(), livemode: boolean(), object: binary() }
The customer_session type.
client_secretThe client secret of this customer session. Used on the client to set up secure access to the givencustomer.
The client secret can be used to provide access to customer from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.
componentscreatedTime at which the object was created. Measured in seconds since the Unix epoch.customerThe customer the customer session was created for.expires_atThe timestamp at which this customer session will expire.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.objectString representing the object's type. Objects of the same type share the same value.
Functions
@spec create( params :: %{ optional(:components) => components(), optional(:customer) => binary(), optional(:expand) => [binary()] }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Details
- Method: 
post - Path: 
/v1/customer_sessions