Class: Stripe::PriceService::CreateParams::ProductData

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/price_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(active: nil, id: nil, metadata: nil, name: nil, statement_descriptor: nil, tax_code: nil, unit_label: nil) ⇒ ProductData

Returns a new instance of ProductData.



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/stripe/services/price_service.rb', line 232

def initialize(
  active: nil,
  id: nil,
  metadata: nil,
  name: nil,
  statement_descriptor: nil,
  tax_code: nil,
  unit_label: nil
)
  @active = active
  @id = id
  @metadata = 
  @name = name
  @statement_descriptor = statement_descriptor
  @tax_code = tax_code
  @unit_label = unit_label
end

Instance Attribute Details

#activeObject

Whether the product is currently available for purchase. Defaults to ‘true`.



210
211
212
# File 'lib/stripe/services/price_service.rb', line 210

def active
  @active
end

#idObject

The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated.



213
214
215
# File 'lib/stripe/services/price_service.rb', line 213

def id
  @id
end

#metadataObject

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



216
217
218
# File 'lib/stripe/services/price_service.rb', line 216

def 
  @metadata
end

#nameObject

The product’s name, meant to be displayable to the customer.



219
220
221
# File 'lib/stripe/services/price_service.rb', line 219

def name
  @name
end

#statement_descriptorObject

An arbitrary string to be displayed on your customer’s credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.

This may be up to 22 characters. The statement description may not include ‘<`, `>`, ``, `“`, `’‘ characters, and will appear on your customer’s statement in capital letters. Non-ASCII characters are automatically stripped.



224
225
226
# File 'lib/stripe/services/price_service.rb', line 224

def statement_descriptor
  @statement_descriptor
end

#tax_codeObject



227
228
229
# File 'lib/stripe/services/price_service.rb', line 227

def tax_code
  @tax_code
end

#unit_labelObject

A label that represents units of this product. When set, this will be included in customers’ receipts, invoices, Checkout, and the customer portal.



230
231
232
# File 'lib/stripe/services/price_service.rb', line 230

def unit_label
  @unit_label
end