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](docs.stripe.com/customer-management)
Defined Under Namespace
Classes: 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.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
- .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
#==, #[], #[]=, #_get_inner_class_type, 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.
197 198 199 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 197 def configuration @configuration end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
199 200 201 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 199 def created @created end |
#customer ⇒ Object (readonly)
The ID of the customer for this session.
201 202 203 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 201 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.
203 204 205 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 203 def flow @flow end |
#id ⇒ Object (readonly)
Unique identifier for the object.
205 206 207 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 205 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.
207 208 209 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 207 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.
209 210 211 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 209 def locale @locale end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
211 212 213 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 211 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.
213 214 215 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 213 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.
215 216 217 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 215 def return_url @return_url end |
#url ⇒ Object (readonly)
The short-lived URL of the session that gives customers access to the customer portal.
217 218 219 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 217 def url @url end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a session of the customer portal.
220 221 222 223 224 225 226 227 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 220 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/billing_portal/sessions", params: params, opts: opts ) end |
.field_remappings ⇒ Object
233 234 235 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 233 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
229 230 231 |
# File 'lib/stripe/resources/billing_portal/session.rb', line 229 def self.inner_class_types @inner_class_types = { flow: Flow } 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 |