Class: Stripe::ProductCreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/product_create_params.rb

Defined Under Namespace

Classes: DefaultPriceData, Identifiers, MarketingFeature, PackageDimensions, TaxDetails

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(active: nil, default_price_data: nil, description: nil, expand: nil, id: nil, identifiers: nil, images: nil, marketing_features: nil, metadata: nil, name: nil, package_dimensions: nil, shippable: nil, statement_descriptor: nil, tax_code: nil, tax_details: nil, type: nil, unit_label: nil, url: nil) ⇒ ProductCreateParams

Returns a new instance of ProductCreateParams.



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/stripe/params/product_create_params.rb', line 298

def initialize(
  active: nil,
  default_price_data: nil,
  description: nil,
  expand: nil,
  id: nil,
  identifiers: nil,
  images: nil,
  marketing_features: nil,
  metadata: nil,
  name: nil,
  package_dimensions: nil,
  shippable: nil,
  statement_descriptor: nil,
  tax_code: nil,
  tax_details: nil,
  type: nil,
  unit_label: nil,
  url: nil
)
  @active = active
  @default_price_data = default_price_data
  @description = description
  @expand = expand
  @id = id
  @identifiers = identifiers
  @images = images
  @marketing_features = marketing_features
  @metadata = 
  @name = name
  @package_dimensions = package_dimensions
  @shippable = shippable
  @statement_descriptor = statement_descriptor
  @tax_code = tax_code
  @tax_details = tax_details
  @type = type
  @unit_label = unit_label
  @url = url
end

Instance Attribute Details

#activeObject

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



259
260
261
# File 'lib/stripe/params/product_create_params.rb', line 259

def active
  @active
end

#default_price_dataObject

Data used to generate a new Price object. This Price will be set as the default price for this product.



261
262
263
# File 'lib/stripe/params/product_create_params.rb', line 261

def default_price_data
  @default_price_data
end

#descriptionObject

The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.



263
264
265
# File 'lib/stripe/params/product_create_params.rb', line 263

def description
  @description
end

#expandObject

Specifies which fields in the response should be expanded.



265
266
267
# File 'lib/stripe/params/product_create_params.rb', line 265

def expand
  @expand
end

#idObject

An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account.



267
268
269
# File 'lib/stripe/params/product_create_params.rb', line 267

def id
  @id
end

#identifiersObject

Other identifiers for this product.



269
270
271
# File 'lib/stripe/params/product_create_params.rb', line 269

def identifiers
  @identifiers
end

#imagesObject

A list of up to 8 URLs of images for this product, meant to be displayable to the customer.



271
272
273
# File 'lib/stripe/params/product_create_params.rb', line 271

def images
  @images
end

#marketing_featuresObject

A list of up to 15 marketing features for this product. These are displayed in pricing tables.



273
274
275
# File 'lib/stripe/params/product_create_params.rb', line 273

def marketing_features
  @marketing_features
end

#metadataObject

Set of key-value pairs 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.



275
276
277
# File 'lib/stripe/params/product_create_params.rb', line 275

def 
  @metadata
end

#nameObject

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



277
278
279
# File 'lib/stripe/params/product_create_params.rb', line 277

def name
  @name
end

#package_dimensionsObject

The dimensions of this product for shipping purposes.



279
280
281
# File 'lib/stripe/params/product_create_params.rb', line 279

def package_dimensions
  @package_dimensions
end

#shippableObject

Whether this product is shipped (i.e., physical goods).



281
282
283
# File 'lib/stripe/params/product_create_params.rb', line 281

def shippable
  @shippable
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. It must contain at least one letter. Only used for subscription payments.



286
287
288
# File 'lib/stripe/params/product_create_params.rb', line 286

def statement_descriptor
  @statement_descriptor
end

#tax_codeObject

A tax code ID.



288
289
290
# File 'lib/stripe/params/product_create_params.rb', line 288

def tax_code
  @tax_code
end

#tax_detailsObject

Tax details for this product, including the tax code and an optional performance location.



290
291
292
# File 'lib/stripe/params/product_create_params.rb', line 290

def tax_details
  @tax_details
end

#typeObject

The type of the product. Defaults to service if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to good to use this product with Orders and SKUs. On API versions before 2018-02-05, this field defaults to good for compatibility reasons.



292
293
294
# File 'lib/stripe/params/product_create_params.rb', line 292

def type
  @type
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.



294
295
296
# File 'lib/stripe/params/product_create_params.rb', line 294

def unit_label
  @unit_label
end

#urlObject

A URL of a publicly-accessible webpage for this product.



296
297
298
# File 'lib/stripe/params/product_create_params.rb', line 296

def url
  @url
end

Class Method Details

.field_encodingsObject



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/stripe/params/product_create_params.rb', line 338

def self.field_encodings
  @field_encodings = {
    default_price_data: {
      kind: :object,
      fields: {
        currency_options: {
          kind: :array,
          element: {
            kind: :object,
            fields: {
              tiers: {
                kind: :array,
                element: {
                  kind: :object,
                  fields: {
                    flat_amount_decimal: :decimal_string,
                    unit_amount_decimal: :decimal_string,
                  },
                },
              },
              unit_amount_decimal: :decimal_string,
            },
          },
        },
        unit_amount_decimal: :decimal_string,
      },
    },
  }
end