Class: CyberSourceMergedSpec::AggregatorInformation1

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

Overview

AggregatorInformation1 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(aggregator_id: SKIP, name: SKIP, sub_merchant: SKIP, additional_properties: nil) ⇒ AggregatorInformation1

Returns a new instance of AggregatorInformation1.



79
80
81
82
83
84
85
86
87
88
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 79

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

  @aggregator_id = aggregator_id unless aggregator_id == SKIP
  @name = name unless name == SKIP
  @sub_merchant = sub_merchant unless sub_merchant == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#aggregator_idString

Value that identifies you as a payment aggregator. Get this value from the processor.

CyberSource through VisaNet

The value for this field corresponds to the following data in the TC 33 capture file5:

  • Record: CP01 TCR6
  • Position: 95-105
  • Field: Payment Facilitator ID This field is supported for Visa, Mastercard and Discover Transactions. FDC Compass
    This value must consist of uppercase characters.

Returns:

  • (String)


24
25
26
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 24

def aggregator_id
  @aggregator_id
end

#nameString

Your payment aggregator business name. American Express Direct
The maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters.\

CyberSource through VisaNet

With American Express, the maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters. The value for this field does not map to the TC 33 capture file5. FDC Compass
This value must consist of uppercase characters.

Returns:

  • (String)


39
40
41
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 39

def name
  @name
end

#sub_merchantSubMerchant1

Your payment aggregator business name. American Express Direct
The maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters.\

CyberSource through VisaNet

With American Express, the maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters. The value for this field does not map to the TC 33 capture file5. FDC Compass
This value must consist of uppercase characters.

Returns:



54
55
56
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 54

def sub_merchant
  @sub_merchant
end

Class Method Details

.from_element(root) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 113

def self.from_element(root)
  aggregator_id = XmlUtilities.from_element(root, 'aggregatorId', String)
  name = XmlUtilities.from_element(root, 'name', String)
  sub_merchant = XmlUtilities.from_element(root, 'SubMerchant1',
                                           SubMerchant1)

  new(aggregator_id: aggregator_id,
      name: name,
      sub_merchant: sub_merchant,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  aggregator_id = hash.key?('aggregatorId') ? hash['aggregatorId'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  sub_merchant = SubMerchant1.from_hash(hash['subMerchant']) if hash['subMerchant']

  # 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.
  AggregatorInformation1.new(aggregator_id: aggregator_id,
                             name: name,
                             sub_merchant: sub_merchant,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aggregator_id'] = 'aggregatorId'
  @_hash['name'] = 'name'
  @_hash['sub_merchant'] = 'subMerchant'
  @_hash
end

.nullablesObject

An array for nullable fields



75
76
77
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 75

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    aggregator_id
    name
    sub_merchant
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



145
146
147
148
149
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 145

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

#to_sObject

Provides a human-readable string representation of the object.



138
139
140
141
142
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 138

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

#to_xml_element(doc, root_name) ⇒ Object



125
126
127
128
129
130
131
132
133
134
135
# File 'lib/cyber_source_merged_spec/models/aggregator_information1.rb', line 125

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

  XmlUtilities.add_as_subelement(doc, root, 'aggregatorId', aggregator_id)
  XmlUtilities.add_as_subelement(doc, root, 'name', name)
  XmlUtilities.add_as_subelement(doc, root, 'SubMerchant1', sub_merchant)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end