Class: CyberSourceMergedSpec::Card125
- Defined in:
- lib/cyber_source_merged_spec/models/card125.rb
Overview
Card125 Model.
Instance Attribute Summary collapse
-
#expiration_month ⇒ String
Two-digit month in which the payment card expires.
-
#expiration_year ⇒ String
Four-digit year in which the payment card expires.
-
#number ⇒ String
The customer’s payment card number, also known as the Primary Account Number (PAN).
-
#source_account_type ⇒ String
Flag that specifies the type of account associated with the card.
-
#type ⇒ String
Three-digit value that indicates the card type.
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(type: SKIP, number: SKIP, expiration_month: SKIP, expiration_year: SKIP, source_account_type: SKIP, additional_properties: nil) ⇒ Card125
constructor
A new instance of Card125.
-
#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(type: SKIP, number: SKIP, expiration_month: SKIP, expiration_year: SKIP, source_account_type: SKIP, additional_properties: nil) ⇒ Card125
Returns a new instance of Card125.
277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 277 def initialize(type: SKIP, number: SKIP, expiration_month: SKIP, expiration_year: SKIP, source_account_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @type = type unless type == SKIP @number = number unless number == SKIP @expiration_month = expiration_month unless expiration_month == SKIP @expiration_year = expiration_year unless expiration_year == SKIP @source_account_type = source_account_type unless source_account_type == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#expiration_month ⇒ String
Two-digit month in which the payment card expires.
Format: MM.
Valid values: 01 through 12. Leading 0 is required.
Barclays and Streamline
For Maestro (UK Domestic) and Maestro (International) cards on Barclays
and Streamline, this must be a valid value
(01 through 12) but is not required to be a valid expiration date. In
other words, an expiration date that is
in the past does not cause CyberSource to reject your request. However, an
invalid expiration date might cause
the issuer to reject your request.
Encoded Account Numbers
For encoded account numbers (type=039), if there is no expiration date
on the card, use 12.
FDMS Nashville
Required field.
All other processors
Required if pointOfSaleInformation.entryMode=keyed. However, this field
is optional if your account is configured
for relaxed requirements for address data and expiration date.
Important It is your responsibility to determine
whether a field is required for the transaction you are requesting.
Google Pay transactions
For PAN-based Google Pay transactions, this field is returned in the API response.
191 192 193 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 191 def expiration_month @expiration_month end |
#expiration_year ⇒ String
Four-digit year in which the payment card expires.
Format: YYYY.
Barclays and Streamline
For Maestro (UK Domestic) and Maestro (International) cards on Barclays
and Streamline, this must be a valid value (1900 through 3000) but is
not required to be a valid expiration date. In other words, an expiration
date that is in the past does not cause CyberSource to reject your
request. However, an invalid expiration date might cause the issuer to
reject your request.
Encoded Account Numbers
For encoded account numbers (**type**=039), if there is no expiration
date on the card, use 2021.
FDMS Nashville
Required field.
FDC Nashville Global and FDMS South
You can send in 2 digits or 4 digits. If you send in 2 digits, they must be the last 2 digits of the year.
All other processors
Required if pointOfSaleInformation.entryMode=keyed. However, this field
is optional if your account is configured
for relaxed requirements for address data and expiration date.
Important It is your responsibility to determine
whether a field is required for the transaction you are requesting.
Google Pay transactions
For PAN-based Google Pay transactions, this field is returned in the API response.
220 221 222 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 220 def expiration_year @expiration_year end |
#number ⇒ String
The customer’s payment card number, also known as the Primary Account Number (PAN). You can also use this field for encoded account numbers.
FDMS Nashville
Required. String (19)
GPX
Required if pointOfSaleInformation.entryMode=keyed. However, this field
is optional if your account is configured
for relaxed requirements for address data and expiration date.
Important It is your responsibility to determine
whether a field is required for the transaction you are requesting.
All other processors
Required if pointOfSaleInformation.entryMode=keyed. However, this field
is optional if your account is configured
for relaxed requirements for address data and expiration date.
Important It is your responsibility to determine
whether a field is required for the transaction you are requesting.
163 164 165 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 163 def number @number end |
#source_account_type ⇒ String
Flag that specifies the type of account associated with the card. The cardholder provides this information during the payment process. This field is required in the following cases:
- Debit transactions on Cielo and Comercio Latino.
- Transactions with Brazilian-issued cards on CyberSource through
VisaNet.
- Applicable only for CyberSource through VisaNet (CtV). Note Combo cards in Brazil contain credit and debit functionality in a single card. Visa systems use a credit bank identification number (BIN) for this type of card. Using the BIN to determine whether a card is debit or credit can cause transactions with these cards to be processed incorrectly. CyberSource strongly recommends that you include this field for combo card transactions. Possible values include the following.
CH: Checking accountCR: Credit card accountSA: Saving accountLI: Line of credit or credit portion of combo cardPP: Prepaid card account or prepaid portion of combo cardUA: Universal account If useAs is set to credit/debit and there is a value in SourceAccountType, the value in the SourceAccountType field will take precedence. If useAs is set to CR/DB and there is a value in SourceAccountType, the value in the useAs field will take precedence.
248 249 250 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 248 def source_account_type @source_account_type end |
#type ⇒ String
Three-digit value that indicates the card type. IMPORTANT It is strongly recommended that you include the card type field in request messages even if it is optional for your processor and card type. Omitting the card type can cause the transaction to be processed with the wrong card type. Possible values:
001: Visa. Use card type value001for Visa Electron.002: Mastercard, Eurocard, which is a European regional brand of Mastercard.003: American Express004: Discover005: Diners Club006: Carte Blanche007: JCB008: Optima009: GE Private Label010: Beneficial Private Label011: Twinpay Credit Card012: Twinpay Debit Card013: WalMart014: Enroute015: Lowe's Consumer016: Home Depot Consumer017: MBNA018: Dick's Sportswear019: Casual Corner020: Sears021: JAL023: Disney Card024: Maestro (UK Domestic)[^1]025: Sam's Club Consumer026: Sam's Club Business027: Nico's028: Paymentech Bill Me Later029: Bebe030: Restoration Hardware031: Delta Online032: Solo033: Visa Electron. Do not use this value. Use001for all Visa card types.034: Dankort035: Laser036: Cartes Bancaires037: Carta Si038: Pinless Debit039: Encoded account number040: UATP041: HOUSEHOLD042: Maestro (International)[^1]043: GE MONEY044: Korean Cards045: Style Cards046: JCrew047: Payeasecn eWallet048: Payeasecn Bank Transfer049: Meijer050: Hipercard051: Aura052: Redecard053: Orico card054: Elo055: Capitol One Private Label056: Carnet057: Costco Private Label058: Carnet059: ValueLink060: MADA061: RuPay062: China UnionPay063: Falabella Private Label064: Prompt Card065: Korean Domestic066: Banricompras067: MEEZA068: PayPak070: EFTPOS071: Codensa072: Olimpica073: Colsubsidio074: Tuya075: Sodexo076: Naranja077: Cabal078: DINELCO079: PANAL080: EPM081: Jaywan [^1]: For this card type, you must include thepaymentInformation.card.typeorpaymentInformation.tokenizedCard.typefield in your request for an authorization or a stand-alone credit. [^2]: For this card type on Cielo 3.0, you must include thepaymentInformation.card.typeorpaymentInformation.tokenizedCard.typefield in a request for an authorization or a stand-alone credit. This card type is not supported on Cielo 1.5. [^3]: For this card type on Getnet and Rede, you must include thepaymentInformation.card.typeorpaymentInformation.tokenizedCard.typefield in a request for an authorization or a stand-alone credit. [^4]: For this card type, you must include thepaymentInformation.card.typein your request for any payer authentication services.
Used by
Authorization Required for Carte Blanche and JCB. Optional for all other card types.
Card Present reply
This field is included in the reply message when the client software that is installed on the POS terminal uses the token management service (TMS) to retrieve tokenized payment details. You must contact customer support to have your account enabled to receive these fields in the credit reply message. Returned by the Credit service. This reply field is only supported by the following processors:
- American Express Direct
- Credit Mutuel-CIC
- FDC Nashville Global
- OmniPay Direct
- SIX
Google Pay transactions
For PAN-based Google Pay transactions, this field is returned in the API response.
GPX
This field only supports transactions from the following card types:
- Visa
- Mastercard
- AMEX
- Discover
- Diners
- JCB
- Union Pay International
143 144 145 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 143 def type @type end |
Class Method Details
.from_element(root) ⇒ Object
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 321 def self.from_element(root) type = XmlUtilities.from_element(root, 'type', String) number = XmlUtilities.from_element(root, 'number', String) expiration_month = XmlUtilities.from_element(root, 'expirationMonth', String) expiration_year = XmlUtilities.from_element(root, 'expirationYear', String) source_account_type = XmlUtilities.from_element(root, 'sourceAccountType', String) new(type: type, number: number, expiration_month: expiration_month, expiration_year: expiration_year, source_account_type: source_account_type, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 292 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : SKIP number = hash.key?('number') ? hash['number'] : SKIP expiration_month = hash.key?('expirationMonth') ? hash['expirationMonth'] : SKIP expiration_year = hash.key?('expirationYear') ? hash['expirationYear'] : SKIP source_account_type = hash.key?('sourceAccountType') ? hash['sourceAccountType'] : 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. Card125.new(type: type, number: number, expiration_month: expiration_month, expiration_year: expiration_year, source_account_type: source_account_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
251 252 253 254 255 256 257 258 259 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 251 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['number'] = 'number' @_hash['expiration_month'] = 'expirationMonth' @_hash['expiration_year'] = 'expirationYear' @_hash['source_account_type'] = 'sourceAccountType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
273 274 275 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 273 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
262 263 264 265 266 267 268 269 270 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 262 def self.optionals %w[ type number expiration_month expiration_year source_account_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
365 366 367 368 369 370 371 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 365 def inspect class_name = self.class.name.split('::').last "<#{class_name} type: #{@type.inspect}, number: #{@number.inspect}, expiration_month:"\ " #{@expiration_month.inspect}, expiration_year: #{@expiration_year.inspect},"\ " source_account_type: #{@source_account_type.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
357 358 359 360 361 362 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 357 def to_s class_name = self.class.name.split('::').last "<#{class_name} type: #{@type}, number: #{@number}, expiration_month: #{@expiration_month},"\ " expiration_year: #{@expiration_year}, source_account_type: #{@source_account_type},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/cyber_source_merged_spec/models/card125.rb', line 339 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'type', type) 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, 'sourceAccountType', source_account_type) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |