Class: Stripe::BillingPortal::Configuration

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/billing_portal/configuration.rb

Overview

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

Defined Under Namespace

Classes: BusinessProfile, CreateParams, Features, ListParams, LoginPage, RetrieveParams, UpdateParams

Constant Summary collapse

OBJECT_NAME =
"billing_portal.configuration"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

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

included

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

#activeObject (readonly)

Whether the configuration is active and can be used to create portal sessions.



553
554
555
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 553

def active
  @active
end

#applicationObject (readonly)

ID of the Connect Application that created the configuration.



555
556
557
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 555

def application
  @application
end

#business_profileObject (readonly)

Attribute for field business_profile



557
558
559
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 557

def business_profile
  @business_profile
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



559
560
561
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 559

def created
  @created
end

#default_return_urlObject (readonly)

The default URL to redirect customers to when they click on the portal’s link to return to your website. This can be [overriden](stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.



561
562
563
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 561

def default_return_url
  @default_return_url
end

#featuresObject (readonly)

Attribute for field features



563
564
565
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 563

def features
  @features
end

#idObject (readonly)

Unique identifier for the object.



565
566
567
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 565

def id
  @id
end

#is_defaultObject (readonly)

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.



567
568
569
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 567

def is_default
  @is_default
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



569
570
571
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 569

def livemode
  @livemode
end

#login_pageObject (readonly)

Attribute for field login_page



571
572
573
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 571

def 
  @login_page
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



573
574
575
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 573

def 
  @metadata
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



575
576
577
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 575

def object
  @object
end

#updatedObject (readonly)

Time at which the object was last updated. Measured in seconds since the Unix epoch.



577
578
579
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 577

def updated
  @updated
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

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



580
581
582
583
584
585
586
587
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 580

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/billing_portal/configurations",
    params: params,
    opts: opts
  )
end

.list(params = {}, opts = {}) ⇒ Object

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



590
591
592
593
594
595
596
597
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 590

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/billing_portal/configurations",
    params: params,
    opts: opts
  )
end

.object_nameObject



13
14
15
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 13

def self.object_name
  "billing_portal.configuration"
end

.update(id, params = {}, opts = {}) ⇒ Object

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



600
601
602
603
604
605
606
607
# File 'lib/stripe/resources/billing_portal/configuration.rb', line 600

def self.update(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/billing_portal/configurations/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end