Class: VisaAcceptanceMergedSpec::CompleteMandate

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

Overview

The completeMandate object is designed to provide instructions for orchestrating payment services. Unified Checkout is capable of orchestrating a number of services on your behalf.

By providing this field in the capture context Unified Checkout will initiate services on your behalf from the browser, simplifying your integration.

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(type: SKIP, decision_manager: SKIP, consumer_authentication: SKIP, additional_properties: nil) ⇒ CompleteMandate

Returns a new instance of CompleteMandate.



86
87
88
89
90
91
92
93
94
95
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 86

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

  @type = type unless type == SKIP
  @decision_manager = decision_manager unless decision_manager == SKIP
  @consumer_authentication = consumer_authentication unless consumer_authentication == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#consumer_authentication ⇒ TrueClass | FalseClass

Configure Unified Checkout to determine whether Consumer Authentication is invoked during service orchestration. Possible values:

  • True
  • False

    Setting this value to True will attempt to perform authentication using the Payer Authentication Service. Setting this value to False (or not provided) indicates that you do not wish to perform authentication using the Payer Authentication Service.

Returns:

  • (TrueClass | FalseClass)


61
62
63
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 61

def consumer_authentication
  @consumer_authentication
end

#decision_manager ⇒ TrueClass | FalseClass

Configure Unified Checkout to determine whether Decision Manager is invoked during service orchestration. Possible values:

  • True
  • False

    Setting this value to True indicates that device fingerprinting will be executed to add additional information for risk service Setting this value to False (or not provided) indicates that you do not wish to run device fingerprinting and skip decision manager services.

Returns:

  • (TrueClass | FalseClass)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 49

def decision_manager
  @decision_manager
end

#type ⇒ String

This field is used to indicate how a payment should be processed. Possible values:

  • AUTH: Use this value when you want to authorize a payment within Unified Checkout without capturing it immediately. Payment types that initiate an immediate transfer of funds are NOT allowed. If a capture context request includes a payment type incompatible with this mode, a 400 error will be returned. A merchant would need to perform their own capture via API where applicable.

  • CAPTURE: Use this value when you want to perform a sale within Unified Checkout and capture the payment immediately during the transaction. Note: Some payment types may return a PENDING status, requiring an additional status check call to determine the final outcome of the payment.

  • PREFER_AUTH: Use this value to offer multiple alternative payment options during the Unified Checkout experience. This option authorizes the payment without immediate capture, where available. It will perform a "CAPTURE" where an "AUTH" is not allowed by the payment type. Transactions can be AUTHORIZED, CAPTURED, or PENDING. If an "AUTH" is performed, a merchant would need to perform their own capture via API where applicable.

Returns:

  • (String)


37
38
39
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 37

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 98

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : SKIP
  decision_manager =
    hash.key?('decisionManager') ? hash['decisionManager'] : SKIP
  consumer_authentication =
    hash.key?('consumerAuthentication') ? hash['consumerAuthentication'] : 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.
  CompleteMandate.new(type: type,
                      decision_manager: decision_manager,
                      consumer_authentication: consumer_authentication,
                      additional_properties: additional_properties)
end

.names ⇒ Object

A mapping from model property names to API property names.



64
65
66
67
68
69
70
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 64

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'type'
  @_hash['decision_manager'] = 'decisionManager'
  @_hash['consumer_authentication'] = 'consumerAuthentication'
  @_hash
end

.nullables ⇒ Object

An array for nullable fields



82
83
84
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 82

def self.nullables
  []
end

.optionals ⇒ Object

An array for optional fields



73
74
75
76
77
78
79
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 73

def self.optionals
  %w[
    type
    decision_manager
    consumer_authentication
  ]
end

Instance Method Details

#inspect ⇒ Object

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 131

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

#to_s ⇒ Object

Provides a human-readable string representation of the object.



123
124
125
126
127
128
# File 'lib/visa_acceptance_merged_spec/models/complete_mandate.rb', line 123

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