Class: CyberSourceMergedSpec::AccountFeatures1

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

Overview

AccountFeatures1 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(category: SKIP, additional_properties: nil) ⇒ AccountFeatures1

Returns a new instance of AccountFeatures1.



67
68
69
70
71
72
73
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 67

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

  @category = category unless category == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#categoryString

GPX

Mastercard product ID associated with the primary account number (PAN). Returned by authorization service.

CyberSource through VisaNet

Visa or Mastercard product ID that is associated with the primary account number (PAN). For descriptions of the Visa product IDs, see the Product ID table on the Visa Request & Response Codes web page. Data Length: String (3)

GPN

Visa or Mastercard product ID that is associated with the primary account number (PAN). For descriptions of the Visa product IDs, see the Product ID table on the Visa Request & Response Codes web page. Data Length: String (3)

Worldpay VAP

Important Before using this field on Worldpay VAP, you must contact CyberSource Customer Support to have your account configured for this feature. Type of card used in the transaction. The only possible value is:

  • PREPAID: Prepaid Card Data Length: String (7)

RBS WorldPay Atlanta

Type of card used in the transaction. Possible values:

  • B: Business Card
  • O: Noncommercial Card
  • R: Corporate Card
  • S: Purchase Card
  • Blank: Purchase card not supported Data Length: String (1)

Returns:

  • (String)


46
47
48
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 46

def category
  @category
end

Class Method Details

.from_element(root) ⇒ Object



94
95
96
97
98
99
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 94

def self.from_element(root)
  category = XmlUtilities.from_element(root, 'category', String)

  new(category: category,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 76

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 49

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

.nullablesObject

An array for nullable fields



63
64
65
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 63

def self.nullables
  []
end

.optionalsObject

An array for optional fields



56
57
58
59
60
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 56

def self.optionals
  %w[
    category
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 118

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

#to_sObject

Provides a human-readable string representation of the object.



112
113
114
115
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 112

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

#to_xml_element(doc, root_name) ⇒ Object



101
102
103
104
105
106
107
108
109
# File 'lib/cyber_source_merged_spec/models/account_features1.rb', line 101

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

  XmlUtilities.add_as_subelement(doc, root, 'category', category)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end