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.



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/stripe/services/checkout/session_service.rb', line 259

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.



245
246
247
# File 'lib/stripe/services/checkout/session_service.rb', line 245

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.



247
248
249
# File 'lib/stripe/services/checkout/session_service.rb', line 247

def key
  @key
end

#labelObject

The label for the field, displayed to the customer.



249
250
251
# File 'lib/stripe/services/checkout/session_service.rb', line 249

def label
  @label
end

#numericObject

Configuration for ‘type=numeric` fields.



251
252
253
# File 'lib/stripe/services/checkout/session_service.rb', line 251

def numeric
  @numeric
end

#optionalObject

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



253
254
255
# File 'lib/stripe/services/checkout/session_service.rb', line 253

def optional
  @optional
end

#textObject

Configuration for ‘type=text` fields.



255
256
257
# File 'lib/stripe/services/checkout/session_service.rb', line 255

def text
  @text
end

#typeObject

The type of the field.



257
258
259
# File 'lib/stripe/services/checkout/session_service.rb', line 257

def type
  @type
end