Class: Stripe::Checkout::SessionService::CreateParams::CustomField

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

Defined Under Namespace

Classes: Dropdown, Label, Numeric, Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(dropdown: nil, key: nil, label: nil, numeric: nil, optional: nil, text: nil, type: nil) ⇒ CustomField

Returns a new instance of CustomField.



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/stripe/services/checkout/session_service.rb', line 338

def initialize(
  dropdown: nil,
  key: nil,
  label: nil,
  numeric: nil,
  optional: nil,
  text: nil,
  type: nil
)
  @dropdown = dropdown
  @key = key
  @label = label
  @numeric = numeric
  @optional = optional
  @text = text
  @type = type
end

Instance Attribute Details

Configuration for ‘type=dropdown` fields.



324
325
326
# File 'lib/stripe/services/checkout/session_service.rb', line 324

def dropdown
  @dropdown
end

#keyObject

String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters.



326
327
328
# File 'lib/stripe/services/checkout/session_service.rb', line 326

def key
  @key
end

#labelObject

The label for the field, displayed to the customer.



328
329
330
# File 'lib/stripe/services/checkout/session_service.rb', line 328

def label
  @label
end

#numericObject

Configuration for ‘type=numeric` fields.



330
331
332
# File 'lib/stripe/services/checkout/session_service.rb', line 330

def numeric
  @numeric
end

#optionalObject

Whether the customer is required to complete the field before completing the Checkout Session. Defaults to ‘false`.



332
333
334
# File 'lib/stripe/services/checkout/session_service.rb', line 332

def optional
  @optional
end

#textObject

Configuration for ‘type=text` fields.



334
335
336
# File 'lib/stripe/services/checkout/session_service.rb', line 334

def text
  @text
end

#typeObject

The type of the field.



336
337
338
# File 'lib/stripe/services/checkout/session_service.rb', line 336

def type
  @type
end