View Source Stripe.BillingPortal.Configuration (stripity_stripe v3.2.0)

A portal configuration describes the functionality and behavior of a portal session.

Summary

Types

The business information shown to customers in the portal.

Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer

Information about updating the customer details in the portal.

Information about the features available in the portal.

Information about showing the billing history in the portal.

The hosted login page for this configuration. Learn more about the portal login page in our integration docs.

Information about updating payment methods in the portal.

Information about canceling subscriptions in the portal.

Information about pausing subscriptions in the portal.

Information about updating subscriptions in the portal.

t()

The billing_portal.configuration type.

Functions

Creates a configuration that describes the functionality and behavior of a PortalSession

Returns a list of configurations that describe the functionality of the customer portal.

Retrieves a configuration that describes the functionality of the customer portal.

Updates a configuration that describes the functionality of the customer portal.

Types

@type business_profile() :: %{
  optional(:headline) => binary() | binary(),
  optional(:privacy_policy_url) => binary(),
  optional(:terms_of_service_url) => binary()
}

The business information shown to customers in the portal.

@type cancellation_reason() :: %{
  optional(:enabled) => boolean(),
  optional(:options) =>
    [
      :customer_service
      | :low_quality
      | :missing_features
      | :other
      | :switched_service
      | :too_complex
      | :too_expensive
      | :unused
    ]
    | binary()
}

Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer

@type customer_update() :: %{
  optional(:allowed_updates) =>
    [:address | :email | :name | :phone | :shipping | :tax_id] | binary(),
  optional(:enabled) => boolean()
}

Information about updating the customer details in the portal.

@type features() :: %{
  optional(:customer_update) => customer_update(),
  optional(:invoice_history) => invoice_history(),
  optional(:payment_method_update) => payment_method_update(),
  optional(:subscription_cancel) => subscription_cancel(),
  optional(:subscription_pause) => subscription_pause(),
  optional(:subscription_update) => subscription_update()
}

Information about the features available in the portal.

@type invoice_history() :: %{optional(:enabled) => boolean()}

Information about showing the billing history in the portal.

@type login_page() :: %{optional(:enabled) => boolean()}

The hosted login page for this configuration. Learn more about the portal login page in our integration docs.

Link to this type

payment_method_update()

View Source
@type payment_method_update() :: %{optional(:enabled) => boolean()}

Information about updating payment methods in the portal.

@type products() :: %{optional(:prices) => [binary()], optional(:product) => binary()}
@type subscription_cancel() :: %{
  optional(:cancellation_reason) => cancellation_reason(),
  optional(:enabled) => boolean(),
  optional(:mode) => :at_period_end | :immediately,
  optional(:proration_behavior) => :always_invoice | :create_prorations | :none
}

Information about canceling subscriptions in the portal.

@type subscription_pause() :: %{optional(:enabled) => boolean()}

Information about pausing subscriptions in the portal.

@type subscription_update() :: %{
  optional(:default_allowed_updates) =>
    [:price | :promotion_code | :quantity] | binary(),
  optional(:enabled) => boolean(),
  optional(:products) => [products()] | binary(),
  optional(:proration_behavior) => :always_invoice | :create_prorations | :none
}

Information about updating subscriptions in the portal.

@type t() :: %Stripe.BillingPortal.Configuration{
  active: boolean(),
  application: (binary() | term() | term()) | nil,
  business_profile: term(),
  created: integer(),
  default_return_url: binary() | nil,
  features: term(),
  id: binary(),
  is_default: boolean(),
  livemode: boolean(),
  login_page: term(),
  metadata: term() | nil,
  object: binary(),
  updated: integer()
}

The billing_portal.configuration type.

  • active Whether the configuration is active and can be used to create portal sessions.
  • application ID of the Connect Application that created the configuration.
  • business_profile
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • default_return_url The default URL to redirect customers to when they click on the portal's link to return to your website. This can be overriden when creating the session.
  • features
  • id Unique identifier for the object.
  • is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • login_page
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • object String representing the object's type. Objects of the same type share the same value.
  • updated Time at which the object was last updated. Measured in seconds since the Unix epoch.

Functions

Link to this function

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

View Source
@spec create(
  params :: %{
    optional(:business_profile) => business_profile(),
    optional(:default_return_url) => binary() | binary(),
    optional(:expand) => [binary()],
    optional(:features) => features(),
    optional(:login_page) => login_page(),
    optional(:metadata) => %{optional(binary()) => binary()}
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a configuration that describes the functionality and behavior of a PortalSession

Details

  • Method: post
  • Path: /v1/billing_portal/configurations
Link to this function

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

View Source
@spec list(
  params :: %{
    optional(:active) => boolean(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:is_default) => boolean(),
    optional(:limit) => integer(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of configurations that describe the functionality of the customer portal.

Details

  • Method: get
  • Path: /v1/billing_portal/configurations
Link to this function

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

View Source
@spec retrieve(
  configuration :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves a configuration that describes the functionality of the customer portal.

Details

  • Method: get
  • Path: /v1/billing_portal/configurations/{configuration}
Link to this function

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

View Source
@spec update(
  configuration :: binary(),
  params :: %{
    optional(:active) => boolean(),
    optional(:business_profile) => business_profile(),
    optional(:default_return_url) => binary() | binary(),
    optional(:expand) => [binary()],
    optional(:features) => features(),
    optional(:login_page) => login_page(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Updates a configuration that describes the functionality of the customer portal.

Details

  • Method: post
  • Path: /v1/billing_portal/configurations/{configuration}