Class: Stripe::SubscriptionItemService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::SubscriptionItemService
- Defined in:
- lib/stripe/services/subscription_item_service.rb
Defined Under Namespace
Classes: CreateParams, DeleteParams, ListParams, RetrieveParams, UpdateParams
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Adds a new item to an existing subscription.
-
#delete(item, params = {}, opts = {}) ⇒ Object
Deletes an item from the subscription.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your subscription items for a given subscription.
-
#retrieve(item, params = {}, opts = {}) ⇒ Object
Retrieves the subscription item with the given ID.
-
#update(item, params = {}, opts = {}) ⇒ Object
Updates the plan or quantity of an item on a current subscription.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
Adds a new item to an existing subscription. No existing items will be changed or replaced.
390 391 392 393 394 395 396 397 398 |
# File 'lib/stripe/services/subscription_item_service.rb', line 390 def create(params = {}, opts = {}) request( method: :post, path: "/v1/subscription_items", params: params, opts: opts, base_address: :api ) end |
#delete(item, params = {}, opts = {}) ⇒ Object
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
401 402 403 404 405 406 407 408 409 |
# File 'lib/stripe/services/subscription_item_service.rb', line 401 def delete(item, params = {}, opts = {}) request( method: :delete, path: format("/v1/subscription_items/%<item>s", { item: CGI.escape(item) }), params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your subscription items for a given subscription.
412 413 414 415 416 417 418 419 420 |
# File 'lib/stripe/services/subscription_item_service.rb', line 412 def list(params = {}, opts = {}) request( method: :get, path: "/v1/subscription_items", params: params, opts: opts, base_address: :api ) end |
#retrieve(item, params = {}, opts = {}) ⇒ Object
Retrieves the subscription item with the given ID.
423 424 425 426 427 428 429 430 431 |
# File 'lib/stripe/services/subscription_item_service.rb', line 423 def retrieve(item, params = {}, opts = {}) request( method: :get, path: format("/v1/subscription_items/%<item>s", { item: CGI.escape(item) }), params: params, opts: opts, base_address: :api ) end |
#update(item, params = {}, opts = {}) ⇒ Object
Updates the plan or quantity of an item on a current subscription.
434 435 436 437 438 439 440 441 442 |
# File 'lib/stripe/services/subscription_item_service.rb', line 434 def update(item, params = {}, opts = {}) request( method: :post, path: format("/v1/subscription_items/%<item>s", { item: CGI.escape(item) }), params: params, opts: opts, base_address: :api ) end |