Class: CyberSourceMergedSpec::Card124

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

Overview

Card124 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(number: SKIP, type: SKIP, bin: SKIP, additional_properties: nil) ⇒ Card124

Returns a new instance of Card124.



193
194
195
196
197
198
199
200
201
202
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 193

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

  @number = number unless number == SKIP
  @type = type unless type == SKIP
  @bin = bin unless bin == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#binString

description: The BIN is the first six digits of the card's Primary Account Number (PAN).

Returns:

  • (String)


168
169
170
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 168

def bin
  @bin
end

#numberString

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.

Returns:

  • (String)


30
31
32
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 30

def number
  @number
end

#typeString

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 value 001 for Visa Electron.
  • 002: Mastercard, Eurocard, which is a European regional brand of Mastercard.
  • 003: American Express
  • 004: Discover
  • 005: Diners Club
  • 006: Carte Blanche
  • 007: JCB
  • 008: Optima
  • 009: GE Private Label
  • 010: Beneficial Private Label
  • 011: Twinpay Credit Card
  • 012: Twinpay Debit Card
  • 013: WalMart
  • 014: Enroute
  • 015: Lowe's Consumer
  • 016: Home Depot Consumer
  • 017: MBNA
  • 018: Dick's Sportswear
  • 019: Casual Corner
  • 020: Sears
  • 021: JAL
  • 023: Disney Card
  • 024: Maestro (UK Domestic)[^1]
  • 025: Sam's Club Consumer
  • 026: Sam's Club Business
  • 027: Nico's
  • 028: Paymentech Bill Me Later
  • 029: Bebe
  • 030: Restoration Hardware
  • 031: Delta Online
  • 032: Solo
  • 033: Visa Electron. Do not use this value. Use 001 for all Visa card types.
  • 034: Dankort
  • 035: Laser
  • 036: Cartes Bancaires
  • 037: Carta Si
  • 038: Pinless Debit
  • 039: Encoded account number
  • 040: UATP
  • 041: HOUSEHOLD
  • 042: Maestro (International)[^1]
  • 043: GE MONEY
  • 044: Korean Cards
  • 045: Style Cards
  • 046: JCrew
  • 047: Payeasecn eWallet
  • 048: Payeasecn Bank Transfer
  • 049: Meijer
  • 050: Hipercard
  • 051: Aura
  • 052: Redecard
  • 053: Orico card
  • 054: Elo
  • 055: Capitol One Private Label
  • 056: Carnet
  • 057: Costco Private Label
  • 058: Carnet
  • 059: ValueLink
  • 060: MADA
  • 061: RuPay
  • 062: China UnionPay
  • 063: Falabella Private Label
  • 064: Prompt Card
  • 065: Korean Domestic
  • 066: Banricompras
  • 067: MEEZA
  • 068: PayPak
  • 070: EFTPOS
  • 071: Codensa
  • 072: Olimpica
  • 073: Colsubsidio
  • 074: Tuya
  • 075: Sodexo
  • 076: Naranja
  • 077: Cabal
  • 078: DINELCO
  • 079: PANAL
  • 080: EPM
  • 081: Jaywan [^1]: For this card type, you must include the paymentInformation.card.type or paymentInformation.tokenizedCard.type field in your request for an authorization or a stand-alone credit. [^2]: For this card type on Cielo 3.0, you must include the paymentInformation.card.type or paymentInformation.tokenizedCard.type field 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 the paymentInformation.card.type or paymentInformation.tokenizedCard.type field in a request for an authorization or a stand-alone credit. [^4]: For this card type, you must include the paymentInformation.card.type in 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

Returns:

  • (String)


163
164
165
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 163

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



227
228
229
230
231
232
233
234
235
236
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 227

def self.from_element(root)
  number = XmlUtilities.from_element(root, 'number', String)
  type = XmlUtilities.from_element(root, 'type', String)
  bin = XmlUtilities.from_element(root, 'bin', String)

  new(number: number,
      type: type,
      bin: bin,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 205

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  number = hash.key?('number') ? hash['number'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  bin = hash.key?('bin') ? hash['bin'] : 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.
  Card124.new(number: number,
              type: type,
              bin: bin,
              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



171
172
173
174
175
176
177
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 171

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['number'] = 'number'
  @_hash['type'] = 'type'
  @_hash['bin'] = 'bin'
  @_hash
end

.nullablesObject

An array for nullable fields



189
190
191
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 189

def self.nullables
  []
end

.optionalsObject

An array for optional fields



180
181
182
183
184
185
186
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 180

def self.optionals
  %w[
    number
    type
    bin
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



258
259
260
261
262
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 258

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

#to_sObject

Provides a human-readable string representation of the object.



251
252
253
254
255
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 251

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

#to_xml_element(doc, root_name) ⇒ Object



238
239
240
241
242
243
244
245
246
247
248
# File 'lib/cyber_source_merged_spec/models/card124.rb', line 238

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, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'bin', bin)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end