Class: CyberSourceMergedSpec::ProcessingInformation65

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

Overview

ProcessingInformation65 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(commerce_indicator: SKIP, authorization_options: SKIP, additional_properties: nil) ⇒ ProcessingInformation65

Returns a new instance of ProcessingInformation65.



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

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

  @commerce_indicator = commerce_indicator unless commerce_indicator == SKIP
  @authorization_options = authorization_options unless authorization_options == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#authorization_optionsRbsAuthorizationOptions

This field is ignored when you provide the subscriptionInformation.originalTransactionId or update the subscription. Commerce Indicator is a way to identify the type of transaction. Some payment card companies use this information when determining discount rates. Valid values:

  • MOTO
  • RECURRING
  • INTERNET Please add the ecommerce indicator based on the rules defined by your gateway/processor. Some gateways may not accept the Commerce Indicator RECURRING with a Zero Dollar Authorization, that is done for subscriptions starting at a future date.


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

def authorization_options
  @authorization_options
end

#commerce_indicatorString

This field is ignored when you provide the subscriptionInformation.originalTransactionId or update the subscription. Commerce Indicator is a way to identify the type of transaction. Some payment card companies use this information when determining discount rates. Valid values:

  • MOTO
  • RECURRING
  • INTERNET Please add the ecommerce indicator based on the rules defined by your gateway/processor. Some gateways may not accept the Commerce Indicator RECURRING with a Zero Dollar Authorization, that is done for subscriptions starting at a future date.

Returns:

  • (String)


27
28
29
# File 'lib/cyber_source_merged_spec/models/processing_information65.rb', line 27

def commerce_indicator
  @commerce_indicator
end

Class Method Details

.from_element(root) ⇒ Object



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

def self.from_element(root)
  commerce_indicator = XmlUtilities.from_element(root, 'commerceIndicator',
                                                 String)
  authorization_options = XmlUtilities.from_element(
    root, 'rbsAuthorizationOptions', RbsAuthorizationOptions
  )

  new(commerce_indicator: commerce_indicator,
      authorization_options: authorization_options,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  commerce_indicator =
    hash.key?('commerceIndicator') ? hash['commerceIndicator'] : SKIP
  authorization_options = RbsAuthorizationOptions.from_hash(hash['authorizationOptions']) if
    hash['authorizationOptions']

  # 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.
  ProcessingInformation65.new(commerce_indicator: commerce_indicator,
                              authorization_options: authorization_options,
                              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/processing_information65.rb', line 47

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['commerce_indicator'] = 'commerceIndicator'
  @_hash['authorization_options'] = 'authorizationOptions'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
# File 'lib/cyber_source_merged_spec/models/processing_information65.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/processing_information65.rb', line 55

def self.optionals
  %w[
    commerce_indicator
    authorization_options
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



133
134
135
136
137
# File 'lib/cyber_source_merged_spec/models/processing_information65.rb', line 133

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

#to_sObject

Provides a human-readable string representation of the object.



126
127
128
129
130
# File 'lib/cyber_source_merged_spec/models/processing_information65.rb', line 126

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

#to_xml_element(doc, root_name) ⇒ Object



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

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

  XmlUtilities.add_as_subelement(doc, root, 'commerceIndicator',
                                 commerce_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'rbsAuthorizationOptions',
                                 authorization_options)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end