Class: Stripe::BillingPortal::Session
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::BillingPortal::Session
- Extended by:
- APIOperations::Create
- Defined in:
- lib/stripe/resources/billing_portal/session.rb
Overview
The Billing customer portal is a Stripe-hosted UI for subscription and billing management.
A portal configuration describes the functionality and features that you want to provide to your customers through the portal.
A portal session describes the instantiation of the customer portal for a particular customer. By visiting the session’s URL, the customer can manage their subscriptions and billing details. For security reasons, sessions are short-lived and will expire if the customer does not visit the URL. Create sessions on-demand when customers intend to manage their subscriptions and billing details.
Related guide: [Customer management](stripe.com/customer-management)
Defined Under Namespace
Classes: CreateParams, Flow
Constant Summary collapse
- OBJECT_NAME =
"billing_portal.session"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
The configuration used by this session, describing the features available.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#customer ⇒ Object
readonly
The ID of the customer for this session.
-
#flow ⇒ Object
readonly
Information about a specific flow for the customer to go through.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#locale ⇒ Object
readonly
The IETF language tag of the locale Customer Portal is displayed in.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#on_behalf_of ⇒ Object
readonly
The account for which the session was created on behalf of.
-
#return_url ⇒ Object
readonly
The URL to redirect customers to when they click on the portal’s link to return to your website.
-
#url ⇒ Object
readonly
The short-lived URL of the session that gives customers access to the customer portal.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a session of the customer portal.
- .object_name ⇒ Object
Methods included from APIOperations::Create
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#configuration ⇒ Object (readonly)
The configuration used by this session, describing the features available.
277 278 279 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 277 def configuration @configuration end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
279 280 281 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 279 def created @created end |
#customer ⇒ Object (readonly)
The ID of the customer for this session.
281 282 283 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 281 def customer @customer end |
#flow ⇒ Object (readonly)
Information about a specific flow for the customer to go through. See the [docs](stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows.
283 284 285 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 283 def flow @flow end |
#id ⇒ Object (readonly)
Unique identifier for the object.
285 286 287 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 285 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
287 288 289 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 287 def livemode @livemode end |
#locale ⇒ Object (readonly)
The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s ‘preferred_locales` or browser’s locale is used.
289 290 291 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 289 def locale @locale end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
291 292 293 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 291 def object @object end |
#on_behalf_of ⇒ Object (readonly)
The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this ‘on_behalf_of` account appear in the portal. For more information, see the [docs](stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account’s branding settings, which the portal displays.
293 294 295 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 293 def on_behalf_of @on_behalf_of end |
#return_url ⇒ Object (readonly)
The URL to redirect customers to when they click on the portal’s link to return to your website.
295 296 297 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 295 def return_url @return_url end |
#url ⇒ Object (readonly)
The short-lived URL of the session that gives customers access to the customer portal.
297 298 299 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 297 def url @url end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a session of the customer portal.
300 301 302 303 304 305 306 307 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 300 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/billing_portal/sessions", params: params, opts: opts ) end |
.object_name ⇒ Object
24 25 26 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 24 def self.object_name "billing_portal.session" end |