Class: VisaAcceptanceMergedSpec::TransientTokenResponseOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb

Overview

TransientTokenResponseOptions Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(include_card_prefix: SKIP, additional_properties: nil) ⇒ TransientTokenResponseOptions

Returns a new instance of TransientTokenResponseOptions.



62
63
64
65
66
67
68
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 62

def initialize(include_card_prefix: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @include_card_prefix = include_card_prefix unless include_card_prefix == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#include_card_prefixTrueClass | FalseClass

Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix. Possible values:

  • True
  • False

    To select the type of card number prefix:
  • No field included: A 6-digit prefix is returned (default)
  • True: An 8-digit prefix is returned
  • False: No prefix is returned

    The following conditions apply:
  • 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more.
  • Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true.
  • Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true.
  • If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.

    Important: If your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure.

Returns:

  • (TrueClass | FalseClass)


41
42
43
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 41

def include_card_prefix
  @include_card_prefix
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  include_card_prefix =
    hash.key?('includeCardPrefix') ? hash['includeCardPrefix'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  TransientTokenResponseOptions.new(include_card_prefix: include_card_prefix,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



44
45
46
47
48
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 44

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['include_card_prefix'] = 'includeCardPrefix'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



51
52
53
54
55
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 51

def self.optionals
  %w[
    include_card_prefix
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



98
99
100
101
102
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 98

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} include_card_prefix: #{@include_card_prefix.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



91
92
93
94
95
# File 'lib/visa_acceptance_merged_spec/models/transient_token_response_options.rb', line 91

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} include_card_prefix: #{@include_card_prefix}, additional_properties:"\
  " #{@additional_properties}>"
end