Class: Stripe::ProductFeatureService

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

Defined Under Namespace

Classes: CreateParams, DeleteParams, ListParams, RetrieveParams

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



53
54
55
56
57
58
59
60
61
# File 'lib/stripe/services/product_feature_service.rb', line 53

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



64
65
66
67
68
69
70
71
72
# File 'lib/stripe/services/product_feature_service.rb', line 64

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



75
76
77
78
79
80
81
82
83
# File 'lib/stripe/services/product_feature_service.rb', line 75

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



86
87
88
89
90
91
92
93
94
# File 'lib/stripe/services/product_feature_service.rb', line 86

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