Class: CyberSourceMergedSpec::AuthorizationOptions1

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

Overview

AuthorizationOptions1 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(service_type: SKIP, additional_properties: nil) ⇒ AuthorizationOptions1

Returns a new instance of AuthorizationOptions1.



52
53
54
55
56
57
58
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 52

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

  @service_type = service_type unless service_type == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#service_typeString

Field is used for back-to-back funding transaction and can be defined as a payment flow that automatically transfers funds through a real-time funding or a live-load. This type of transaction can also be connected to a purchase. In back-to-back funding of general purpose card that is used to make a purchase, two separate accounts are involved:

  • account one is used to make the purchase
  • account two is used to automatically fund or reimburse account one Possible values:
  • 0B = back to back funding transaction
  • 00 = normal transaction
  • 01 = originator hold
  • 02 = Visa deferred OCT hold, default interval
  • 03 = Visa deferred OCT hold, user-defined interval
  • 09 = Cancel pending deferred OCT request
  • 0I = Visa Direct custom program 1
  • 0Q = uery the status of the deferred OCT
  • A0 = Alias Directory 2

Returns:

  • (String)


31
32
33
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 31

def service_type
  @service_type
end

Class Method Details

.from_element(root) ⇒ Object



79
80
81
82
83
84
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 79

def self.from_element(root)
  service_type = XmlUtilities.from_element(root, 'serviceType', String)

  new(service_type: service_type,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 61

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 34

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

.nullablesObject

An array for nullable fields



48
49
50
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 48

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 41

def self.optionals
  %w[
    service_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



104
105
106
107
108
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 104

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

#to_sObject

Provides a human-readable string representation of the object.



97
98
99
100
101
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 97

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

#to_xml_element(doc, root_name) ⇒ Object



86
87
88
89
90
91
92
93
94
# File 'lib/cyber_source_merged_spec/models/authorization_options1.rb', line 86

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

  XmlUtilities.add_as_subelement(doc, root, 'serviceType', service_type)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end