Class: CyberSourceMergedSpec::MerchantDefinedInformation7

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

Overview

MerchantDefinedInformation7 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, value: SKIP, additional_properties: nil) ⇒ MerchantDefinedInformation7

Returns a new instance of MerchantDefinedInformation7.



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

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

  @name = name unless name == SKIP
  @value = value unless value == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#nameString

The number you assign as the name for your merchant-defined data or secure field. Possible Values are data1 to data4 and sensitive1 to sensitive4 For example, to set the name for merchant-defined data 2 field, you would reference merchantDefinedInformation.name as data2 Possible Values:

  • data1
  • data2
  • data3
  • data4
  • sensitive1
  • sensitive2
  • sensitive3
  • sensitive4

Returns:

  • (String)


26
27
28
# File 'lib/cyber_source_merged_spec/models/merchant_defined_information7.rb', line 26

def name
  @name
end

#valueString

The value you assign for your merchant-defined data field. Warning Merchant-defined data fields are not intended to and must not be used to capture personally identifying information. Accordingly, merchants are prohibited from capturing, obtaining, and/or transmitting any personally identifying information in or via the merchant-defined data fields. Personally identifying information includes, but is not limited to, address, credit card number, social security number, driver's license number, state-issued identification number, passport number, and card verification numbers (CVV, CVC2, CVV2, CID, CVN). In the event it is discovered a merchant is capturing and/or transmitting personally identifying information via the merchant-defined data fields, whether or not intentionally, the merchant's account will immediately be suspended, which will result in a rejection of any and all transaction requests submitted by the merchant after the point of suspension.

Returns:

  • (String)


44
45
46
# File 'lib/cyber_source_merged_spec/models/merchant_defined_information7.rb', line 44

def value
  @value
end

Class Method Details

.from_element(root) ⇒ Object



97
98
99
100
101
102
103
104
# File 'lib/cyber_source_merged_spec/models/merchant_defined_information7.rb', line 97

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

  new(name: name,
      value: value,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



47
48
49
50
51
52
# File 'lib/cyber_source_merged_spec/models/merchant_defined_information7.rb', line 47

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    name
    value
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



125
126
127
128
129
# File 'lib/cyber_source_merged_spec/models/merchant_defined_information7.rb', line 125

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

#to_sObject

Provides a human-readable string representation of the object.



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

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

#to_xml_element(doc, root_name) ⇒ Object



106
107
108
109
110
111
112
113
114
115
# File 'lib/cyber_source_merged_spec/models/merchant_defined_information7.rb', line 106

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

  root
end