Class: Stripe::ProductFeatureService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/product_feature_service.rb

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(product, params = {}, opts = {}) ⇒ Object

Creates a product_feature, which represents a feature attachment to a product



7
8
9
10
11
12
13
14
15
# File 'lib/stripe/services/product_feature_service.rb', line 7

def create(product, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/products/%<product>s/features", { product: CGI.escape(product) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Deletes the feature attachment to a product



18
19
20
21
22
23
24
25
26
# File 'lib/stripe/services/product_feature_service.rb', line 18

def delete(product, id, params = {}, opts = {})
  request(
    method: :delete,
    path: format("/v1/products/%<product>s/features/%<id>s", { product: CGI.escape(product), id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Retrieve a list of features for a product



29
30
31
32
33
34
35
36
37
# File 'lib/stripe/services/product_feature_service.rb', line 29

def list(product, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/products/%<product>s/features", { product: CGI.escape(product) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Retrieves a product_feature, which represents a feature attachment to a product



40
41
42
43
44
45
46
47
48
# File 'lib/stripe/services/product_feature_service.rb', line 40

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