Class: CyberSourceMergedSpec::AuthorizationOptions5

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

Overview

AuthorizationOptions5 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(auth_type: SKIP, auth_indicator: SKIP, extend_auth_indicator: SKIP, card_verification_indicator: SKIP, initiator: SKIP, additional_properties: nil) ⇒ AuthorizationOptions5

Returns a new instance of AuthorizationOptions5.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 108

def initialize(auth_type: SKIP, auth_indicator: SKIP,
               extend_auth_indicator: SKIP,
               card_verification_indicator: SKIP, initiator: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @auth_type = auth_type unless auth_type == SKIP
  @auth_indicator = auth_indicator unless auth_indicator == SKIP
  @extend_auth_indicator = extend_auth_indicator unless extend_auth_indicator == SKIP
  unless card_verification_indicator == SKIP
    @card_verification_indicator =
      card_verification_indicator
  end
  @initiator = initiator unless initiator == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#auth_indicatorString

Flag that specifies the purpose of the authorization. Possible values:

  • 0: Preauthorization
  • 1: Final authorization To set the default for this field, contact CyberSource Customer Support.

Barclays and Elavon

The default for Barclays and Elavon is 1 (final authorization). To change the default for this field, contact CyberSource Customer Support.

CyberSource through VisaNet

When the value for this field is 0, it corresponds to the following data in the TC 33 capture file:

  • Record: CP01 TCR0
  • Position: 164
  • Field: Additional Authorization Indicators When the value for this field is 1, it does not correspond to any data in the TC 33 capture file.

Returns:

  • (String)


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

def auth_indicator
  @auth_indicator
end

#auth_typeString

Authorization type. Possible values:

  • AUTOCAPTURE: automatic capture.
  • STANDARDCAPTURE: standard capture.
  • VERBAL: forced capture. Include it in the payment request for a forced capture. Include it in the capture request for a verbal payment.

Asia, Middle East, and Africa Gateway; Cielo; Comercio Latino; and

CyberSource Latin American Processing Set this field to AUTOCAPTURE and include it in a bundled request to indicate that you are requesting an automatic capture. If your account is configured to enable automatic captures, set this field to STANDARDCAPTURE and include it in a standard authorization or bundled request to indicate that you are overriding an automatic capture.

Forced Capture

Set this field to VERBAL and include it in the authorization request to indicate that you are performing a forced capture; therefore, you receive the authorization code outside the CyberSource system.

Verbal Authorization

Set this field to VERBAL and include it in the capture request to indicate that the request is for a verbal authorization.

for PayPal ptsV2CreateOrderPost400Response

Set this field to 'AUTHORIZE' or 'CAPTURE' depending on whether you want to invoke delayed capture or sale respectively.

Returns:

  • (String)


35
36
37
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 35

def auth_type
  @auth_type
end

#card_verification_indicatorTrueClass | FalseClass

This API field will indicate whether a card verification check is being performed during the transaction Possible values:

- `true`
- `false` (default value)

Returns:

  • (TrueClass | FalseClass)


71
72
73
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 71

def card_verification_indicator
  @card_verification_indicator
end

#extend_auth_indicatorString

Indicates Authorization extension transaction. Extension transaction is used to prolong the settlement period by one additional settlement cycle period. Possible values:

  • true: Transaction is an Authorization Extension transaction.
  • false: Transaction is not an Authorization Extension transaction.

Returns:

  • (String)


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

def extend_auth_indicator
  @extend_auth_indicator
end

#initiatorInitiator34

This API field will indicate whether a card verification check is being performed during the transaction Possible values:

- `true`
- `false` (default value)

Returns:



79
80
81
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 79

def initiator
  @initiator
end

Class Method Details

.from_element(root) ⇒ Object



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 155

def self.from_element(root)
  auth_type = XmlUtilities.from_element(root, 'authType', String)
  auth_indicator = XmlUtilities.from_element(root, 'authIndicator', String)
  extend_auth_indicator = XmlUtilities.from_element(root,
                                                    'extendAuthIndicator',
                                                    String)
  card_verification_indicator = XmlUtilities.from_element(
    root, 'cardVerificationIndicator', TrueClass
  )
  initiator = XmlUtilities.from_element(root, 'Initiator34', Initiator34)

  new(auth_type: auth_type,
      auth_indicator: auth_indicator,
      extend_auth_indicator: extend_auth_indicator,
      card_verification_indicator: card_verification_indicator,
      initiator: initiator,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 127

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  auth_type = hash.key?('authType') ? hash['authType'] : SKIP
  auth_indicator = hash.key?('authIndicator') ? hash['authIndicator'] : SKIP
  extend_auth_indicator =
    hash.key?('extendAuthIndicator') ? hash['extendAuthIndicator'] : SKIP
  card_verification_indicator =
    hash.key?('cardVerificationIndicator') ? hash['cardVerificationIndicator'] : SKIP
  initiator = Initiator34.from_hash(hash['initiator']) if hash['initiator']

  # 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.
  AuthorizationOptions5.new(auth_type: auth_type,
                            auth_indicator: auth_indicator,
                            extend_auth_indicator: extend_auth_indicator,
                            card_verification_indicator: card_verification_indicator,
                            initiator: initiator,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



82
83
84
85
86
87
88
89
90
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 82

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auth_type'] = 'authType'
  @_hash['auth_indicator'] = 'authIndicator'
  @_hash['extend_auth_indicator'] = 'extendAuthIndicator'
  @_hash['card_verification_indicator'] = 'cardVerificationIndicator'
  @_hash['initiator'] = 'initiator'
  @_hash
end

.nullablesObject

An array for nullable fields



104
105
106
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 104

def self.nullables
  []
end

.optionalsObject

An array for optional fields



93
94
95
96
97
98
99
100
101
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 93

def self.optionals
  %w[
    auth_type
    auth_indicator
    extend_auth_indicator
    card_verification_indicator
    initiator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



200
201
202
203
204
205
206
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 200

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

#to_sObject

Provides a human-readable string representation of the object.



191
192
193
194
195
196
197
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 191

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

#to_xml_element(doc, root_name) ⇒ Object



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/cyber_source_merged_spec/models/authorization_options5.rb', line 174

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

  XmlUtilities.add_as_subelement(doc, root, 'authType', auth_type)
  XmlUtilities.add_as_subelement(doc, root, 'authIndicator', auth_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'extendAuthIndicator',
                                 extend_auth_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'cardVerificationIndicator',
                                 card_verification_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'Initiator34', initiator)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end