Class: Stripe::V2::Billing::PricingPlans::ComponentService

Inherits:
StripeService
  • Object
show all
Defined in:
lib/stripe/services/v2/billing/pricing_plans/component_service.rb

Defined Under Namespace

Classes: CreateParams, DeleteParams, ListParams, RetrieveParams, UpdateParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

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

Create a Pricing Plan Component object.



105
106
107
108
109
110
111
112
113
# File 'lib/stripe/services/v2/billing/pricing_plans/component_service.rb', line 105

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

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

Remove a Pricing Plan Component from the latest version of a Pricing Plan.



116
117
118
119
120
121
122
123
124
# File 'lib/stripe/services/v2/billing/pricing_plans/component_service.rb', line 116

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

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

List all Pricing Plan Component objects for a Pricing Plan.



127
128
129
130
131
132
133
134
135
# File 'lib/stripe/services/v2/billing/pricing_plans/component_service.rb', line 127

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

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

Retrieve a Pricing Plan Component object.



138
139
140
141
142
143
144
145
146
# File 'lib/stripe/services/v2/billing/pricing_plans/component_service.rb', line 138

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

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

Update a Pricing Plan Component object.



149
150
151
152
153
154
155
156
157
# File 'lib/stripe/services/v2/billing/pricing_plans/component_service.rb', line 149

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