Class: Stripe::V2::Billing::PricingPlanService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/v2/billing/pricing_plan_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ PricingPlanService

Returns a new instance of PricingPlanService.



10
11
12
13
14
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 10

def initialize(requestor)
  super
  @components = Stripe::V2::Billing::PricingPlans::ComponentService.new(@requestor)
  @versions = Stripe::V2::Billing::PricingPlans::VersionService.new(@requestor)
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components.



8
9
10
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 8

def components
  @components
end

#versionsObject (readonly)

Returns the value of attribute versions.



8
9
10
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 8

def versions
  @versions
end

Instance Method Details

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

Create a Pricing Plan object.



17
18
19
20
21
22
23
24
25
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 17

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v2/billing/pricing_plans",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

List all Pricing Plan objects.



28
29
30
31
32
33
34
35
36
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 28

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v2/billing/pricing_plans",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Retrieve a Pricing Plan object.



39
40
41
42
43
44
45
46
47
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 39

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v2/billing/pricing_plans/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Update a Pricing Plan object.



50
51
52
53
54
55
56
57
58
# File 'lib/stripe/services/v2/billing/pricing_plan_service.rb', line 50

def update(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/billing/pricing_plans/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end