Class: VisaAcceptanceMergedSpec::ProcessingInformation23

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/processing_information23.rb

Overview

ProcessingInformation23 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(session_type: SKIP, payment_flow_mode: SKIP, action_list: SKIP, additional_properties: nil) ⇒ ProcessingInformation23

Returns a new instance of ProcessingInformation23.



51
52
53
54
55
56
57
58
59
60
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 51

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

  @session_type = session_type unless session_type == SKIP
  @payment_flow_mode = payment_flow_mode unless payment_flow_mode == SKIP
  @action_list = action_list unless action_list == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#action_listArray[String]

Possible values are one or more of follows:

  • AP_SESSIONS: Use this when Alternative Payment Sessions service is requested.

Returns:

  • (Array[String])


26
27
28
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 26

def action_list
  @action_list
end

#payment_flow_modeString

Whether merchant wants to pass the flow Inline or want to invoke Klarna Hosted Page

Returns:

  • (String)


20
21
22
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 20

def payment_flow_mode
  @payment_flow_mode
end

#session_typeString

Will have 2 values, 'U' (Update) , 'N' (New). Any other values will be rejected. Default will be 'N'

Returns:

  • (String)


15
16
17
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 15

def session_type
  @session_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  session_type = hash.key?('sessionType') ? hash['sessionType'] : SKIP
  payment_flow_mode =
    hash.key?('paymentFlowMode') ? hash['paymentFlowMode'] : SKIP
  action_list = hash.key?('actionList') ? hash['actionList'] : 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.
  ProcessingInformation23.new(session_type: session_type,
                              payment_flow_mode: payment_flow_mode,
                              action_list: action_list,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['session_type'] = 'sessionType'
  @_hash['payment_flow_mode'] = 'paymentFlowMode'
  @_hash['action_list'] = 'actionList'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



38
39
40
41
42
43
44
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 38

def self.optionals
  %w[
    session_type
    payment_flow_mode
    action_list
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
99
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 94

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

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/visa_acceptance_merged_spec/models/processing_information23.rb', line 87

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