Class: CyberSourceMergedSpec::IssuerInformation35

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/issuer_information35.rb

Overview

IssuerInformation35 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(name: SKIP, country: SKIP, bin_length: SKIP, phone_number: SKIP, transaction_information: SKIP, additional_properties: nil) ⇒ IssuerInformation35

Returns a new instance of IssuerInformation35.



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 65

def initialize(name: SKIP, country: SKIP, bin_length: SKIP,
               phone_number: SKIP, transaction_information: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @country = country unless country == SKIP
  @bin_length = bin_length unless bin_length == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @transaction_information = transaction_information unless transaction_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#bin_lengthString

This field contains the length of the BIN.

Returns:

  • (String)


24
25
26
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 24

def bin_length
  @bin_length
end

#countryString

This field contains [2-character ISO Country Codes](http://apps.cybersource.com/library/documentation/sbc/quickref/coun tries_alpha_list.pdf) for the issuer.

Returns:

  • (String)


20
21
22
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 20

def country
  @country
end

#nameString

This field contains the issuer name.

Returns:

  • (String)


14
15
16
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 14

def name
  @name
end

#phone_numberString

This field contains the customer service phone number for the issuer.

Returns:

  • (String)


28
29
30
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 28

def phone_number
  @phone_number
end

#transaction_informationString

In a Mastercard Transaction, this field contains the unique identifier (Transaction Link ID) for the first transaction in a transaction life cycle. This ID is crucial for maintaining continuity and linking subsequent operations to the original transaction.

Returns:

  • (String)


36
37
38
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 36

def transaction_information
  @transaction_information
end

Class Method Details

.from_element(root) ⇒ Object



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 107

def self.from_element(root)
  name = XmlUtilities.from_element(root, 'name', String)
  country = XmlUtilities.from_element(root, 'country', String)
  bin_length = XmlUtilities.from_element(root, 'binLength', String)
  phone_number = XmlUtilities.from_element(root, 'phoneNumber', String)
  transaction_information = XmlUtilities.from_element(
    root, 'transactionInformation', String
  )

  new(name: name,
      country: country,
      bin_length: bin_length,
      phone_number: phone_number,
      transaction_information: transaction_information,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 80

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  bin_length = hash.key?('binLength') ? hash['binLength'] : SKIP
  phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP
  transaction_information =
    hash.key?('transactionInformation') ? hash['transactionInformation'] : 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.
  IssuerInformation35.new(name: name,
                          country: country,
                          bin_length: bin_length,
                          phone_number: phone_number,
                          transaction_information: transaction_information,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



39
40
41
42
43
44
45
46
47
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 39

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['country'] = 'country'
  @_hash['bin_length'] = 'binLength'
  @_hash['phone_number'] = 'phoneNumber'
  @_hash['transaction_information'] = 'transactionInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 50

def self.optionals
  %w[
    name
    country
    bin_length
    phone_number
    transaction_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



148
149
150
151
152
153
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 148

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

#to_sObject

Provides a human-readable string representation of the object.



140
141
142
143
144
145
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 140

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

#to_xml_element(doc, root_name) ⇒ Object



124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/cyber_source_merged_spec/models/issuer_information35.rb', line 124

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'name', name)
  XmlUtilities.add_as_subelement(doc, root, 'country', country)
  XmlUtilities.add_as_subelement(doc, root, 'binLength', bin_length)
  XmlUtilities.add_as_subelement(doc, root, 'phoneNumber', phone_number)
  XmlUtilities.add_as_subelement(doc, root, 'transactionInformation',
                                 transaction_information)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end