Class: CyberSourceMergedSpec::AuthorizationOptions4

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

Overview

AuthorizationOptions4 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, additional_properties: nil) ⇒ AuthorizationOptions4

Returns a new instance of AuthorizationOptions4.



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

def initialize(auth_type: 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#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_options4.rb', line 35

def auth_type
  @auth_type
end

Class Method Details

.from_element(root) ⇒ Object



83
84
85
86
87
88
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 83

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

  new(auth_type: auth_type,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 65

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 38

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

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 45

def self.optionals
  %w[
    auth_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 108

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

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 101

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

#to_xml_element(doc, root_name) ⇒ Object



90
91
92
93
94
95
96
97
98
# File 'lib/cyber_source_merged_spec/models/authorization_options4.rb', line 90

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, 'additional_properties',
                                 additional_properties)

  root
end