Class: CyberSourceMergedSpec::Card15
- Defined in:
- lib/cyber_source_merged_spec/models/card15.rb
Overview
Card15 Model.
Instance Attribute Summary collapse
-
#activation_date ⇒ Date
Card activation date.
-
#expiration_month ⇒ String
Two-digit month in which the payment card expires.
-
#expiration_printed ⇒ TrueClass | FalseClass
Indicates if the expiration date is printed on the card.
-
#expiration_year ⇒ String
Four-digit year in which the credit card expires.
-
#issue_date ⇒ Date
Card issuance date.
-
#number ⇒ String
The latest customer’s payment card number associated to the network token.
-
#security_code_printed ⇒ TrueClass | FalseClass
Indicates if the Card Verification Number is printed on the card.
-
#suffix ⇒ String
The customer’s latest payment card number suffix.
-
#terms_and_conditions ⇒ TermsAndConditions
Indicates if the Card Verification Number is printed on the card.
-
#type ⇒ String
The type of card (Card Network).
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(number: SKIP, expiration_month: SKIP, expiration_year: SKIP, type: SKIP, suffix: SKIP, issue_date: SKIP, activation_date: SKIP, expiration_printed: SKIP, security_code_printed: SKIP, terms_and_conditions: SKIP, additional_properties: nil) ⇒ Card15
constructor
A new instance of Card15.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(number: SKIP, expiration_month: SKIP, expiration_year: SKIP, type: SKIP, suffix: SKIP, issue_date: SKIP, activation_date: SKIP, expiration_printed: SKIP, security_code_printed: SKIP, terms_and_conditions: SKIP, additional_properties: nil) ⇒ Card15
Returns a new instance of Card15.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 97 def initialize(number: SKIP, expiration_month: SKIP, expiration_year: SKIP, type: SKIP, suffix: SKIP, issue_date: SKIP, activation_date: SKIP, expiration_printed: SKIP, security_code_printed: SKIP, terms_and_conditions: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @number = number unless number == SKIP @expiration_month = expiration_month unless expiration_month == SKIP @expiration_year = expiration_year unless expiration_year == SKIP @type = type unless type == SKIP @suffix = suffix unless suffix == SKIP @issue_date = issue_date unless issue_date == SKIP @activation_date = activation_date unless activation_date == SKIP @expiration_printed = expiration_printed unless expiration_printed == SKIP @security_code_printed = security_code_printed unless security_code_printed == SKIP @terms_and_conditions = terms_and_conditions unless terms_and_conditions == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#activation_date ⇒ Date
Card activation date. XML date format: YYYY-MM-DD
46 47 48 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 46 def activation_date @activation_date end |
#expiration_month ⇒ String
Two-digit month in which the payment card expires.
Format: MM.
Possible Values: 01 through 12.
20 21 22 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 20 def expiration_month @expiration_month end |
#expiration_printed ⇒ TrueClass | FalseClass
Indicates if the expiration date is printed on the card.
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 50 def expiration_printed @expiration_printed end |
#expiration_year ⇒ String
Four-digit year in which the credit card expires.
Format: YYYY.
25 26 27 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 25 def expiration_year @expiration_year end |
#issue_date ⇒ Date
Card issuance date. XML date format: YYYY-MM-DD.
42 43 44 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 42 def issue_date @issue_date end |
#number ⇒ String
The latest customer’s payment card number associated to the network token.
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 14 def number @number end |
#security_code_printed ⇒ TrueClass | FalseClass
Indicates if the Card Verification Number is printed on the card.
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 54 def security_code_printed @security_code_printed end |
#suffix ⇒ String
The customer’s latest payment card number suffix.
38 39 40 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 38 def suffix @suffix end |
#terms_and_conditions ⇒ TermsAndConditions
Indicates if the Card Verification Number is printed on the card.
58 59 60 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 58 def terms_and_conditions @terms_and_conditions end |
#type ⇒ String
The type of card (Card Network). Possible Values:
- 001: visa
- 002: mastercard
- 003: american express
- 007: jcb
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 34 def type @type end |
Class Method Details
.from_element(root) ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 161 def self.from_element(root) number = XmlUtilities.from_element(root, 'number', String) expiration_month = XmlUtilities.from_element(root, 'expirationMonth', String) expiration_year = XmlUtilities.from_element(root, 'expirationYear', String) type = XmlUtilities.from_element(root, 'type', String) suffix = XmlUtilities.from_element(root, 'suffix', String) issue_date = XmlUtilities.from_element(root, 'issueDate', String) activation_date = XmlUtilities.from_element(root, 'activationDate', String) expiration_printed = XmlUtilities.from_element(root, 'expirationPrinted', TrueClass) security_code_printed = XmlUtilities.from_element(root, 'securityCodePrinted', TrueClass) terms_and_conditions = XmlUtilities.from_element(root, 'TermsAndConditions', TermsAndConditions) new(number: number, expiration_month: expiration_month, expiration_year: expiration_year, type: type, suffix: suffix, issue_date: issue_date, activation_date: activation_date, expiration_printed: expiration_printed, security_code_printed: security_code_printed, terms_and_conditions: terms_and_conditions, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 119 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. number = hash.key?('number') ? hash['number'] : SKIP expiration_month = hash.key?('expirationMonth') ? hash['expirationMonth'] : SKIP expiration_year = hash.key?('expirationYear') ? hash['expirationYear'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP suffix = hash.key?('suffix') ? hash['suffix'] : SKIP issue_date = hash.key?('issueDate') ? hash['issueDate'] : SKIP activation_date = hash.key?('activationDate') ? hash['activationDate'] : SKIP expiration_printed = hash.key?('expirationPrinted') ? hash['expirationPrinted'] : SKIP security_code_printed = hash.key?('securityCodePrinted') ? hash['securityCodePrinted'] : SKIP terms_and_conditions = TermsAndConditions.from_hash(hash['termsAndConditions']) if hash['termsAndConditions'] # 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. Card15.new(number: number, expiration_month: expiration_month, expiration_year: expiration_year, type: type, suffix: suffix, issue_date: issue_date, activation_date: activation_date, expiration_printed: expiration_printed, security_code_printed: security_code_printed, terms_and_conditions: terms_and_conditions, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['number'] = 'number' @_hash['expiration_month'] = 'expirationMonth' @_hash['expiration_year'] = 'expirationYear' @_hash['type'] = 'type' @_hash['suffix'] = 'suffix' @_hash['issue_date'] = 'issueDate' @_hash['activation_date'] = 'activationDate' @_hash['expiration_printed'] = 'expirationPrinted' @_hash['security_code_printed'] = 'securityCodePrinted' @_hash['terms_and_conditions'] = 'termsAndConditions' @_hash end |
.nullables ⇒ Object
An array for nullable fields
93 94 95 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 93 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 77 def self.optionals %w[ number expiration_month expiration_year type suffix issue_date activation_date expiration_printed security_code_printed terms_and_conditions ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
231 232 233 234 235 236 237 238 239 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 231 def inspect class_name = self.class.name.split('::').last "<#{class_name} number: #{@number.inspect}, expiration_month: #{@expiration_month.inspect},"\ " expiration_year: #{@expiration_year.inspect}, type: #{@type.inspect}, suffix:"\ " #{@suffix.inspect}, issue_date: #{@issue_date.inspect}, activation_date:"\ " #{@activation_date.inspect}, expiration_printed: #{@expiration_printed.inspect},"\ " security_code_printed: #{@security_code_printed.inspect}, terms_and_conditions:"\ " #{@terms_and_conditions.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
220 221 222 223 224 225 226 227 228 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 220 def to_s class_name = self.class.name.split('::').last "<#{class_name} number: #{@number}, expiration_month: #{@expiration_month},"\ " expiration_year: #{@expiration_year}, type: #{@type}, suffix: #{@suffix}, issue_date:"\ " #{@issue_date}, activation_date: #{@activation_date}, expiration_printed:"\ " #{@expiration_printed}, security_code_printed: #{@security_code_printed},"\ " terms_and_conditions: #{@terms_and_conditions}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/cyber_source_merged_spec/models/card15.rb', line 194 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'number', number) XmlUtilities.add_as_subelement(doc, root, 'expirationMonth', expiration_month) XmlUtilities.add_as_subelement(doc, root, 'expirationYear', expiration_year) XmlUtilities.add_as_subelement(doc, root, 'type', type) XmlUtilities.add_as_subelement(doc, root, 'suffix', suffix) XmlUtilities.add_as_subelement(doc, root, 'issueDate', issue_date) XmlUtilities.add_as_subelement(doc, root, 'activationDate', activation_date) XmlUtilities.add_as_subelement(doc, root, 'expirationPrinted', expiration_printed) XmlUtilities.add_as_subelement(doc, root, 'securityCodePrinted', security_code_printed) XmlUtilities.add_as_subelement(doc, root, 'TermsAndConditions', terms_and_conditions) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |