Class: VisaAcceptanceMergedSpec::AuthorizationOptions4

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_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, verbal_auth_code: SKIP, verbal_auth_transaction_id: SKIP, additional_properties: nil) ⇒ AuthorizationOptions4

Returns a new instance of AuthorizationOptions4.



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/visa_acceptance_merged_spec/models/authorization_options4.rb', line 87

def initialize(auth_type: SKIP, verbal_auth_code: SKIP,
               verbal_auth_transaction_id: 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
  @verbal_auth_code = verbal_auth_code unless verbal_auth_code == SKIP
  unless verbal_auth_transaction_id == SKIP
    @verbal_auth_transaction_id =
      verbal_auth_transaction_id
  end
  @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

Visa Acceptance 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 Visa Acceptance 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/visa_acceptance_merged_spec/models/authorization_options4.rb', line 35

def auth_type
  @auth_type
end

#verbal_auth_codeString

Authorization code.

Forced Capture

Use this field to send the authorization code you received from a payment that you authorized outside the Visa Acceptance system.

PIN debit

Authorization code that is returned by the processor. Returned by PIN debit purchase.

Verbal Authorization

Use this field in CAPTURE API to send the verbally received authorization code.

Returns:

  • (String)


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

def verbal_auth_code
  @verbal_auth_code
end

#verbal_auth_transaction_idString

Transaction ID (TID).

FDMS South

This field is required for verbal authorizations and forced captures with the American Express card type to comply with the CAPN requirements:

  • Forced capture: Obtain the value for this field from the authorization response.
  • Verbal authorization: You cannot obtain a value for this field so Visa Acceptance uses the default value of 000000000000000 (15 zeros).

Returns:

  • (String)


62
63
64
# File 'lib/visa_acceptance_merged_spec/models/authorization_options4.rb', line 62

def verbal_auth_transaction_id
  @verbal_auth_transaction_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/visa_acceptance_merged_spec/models/authorization_options4.rb', line 102

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



83
84
85
# File 'lib/visa_acceptance_merged_spec/models/authorization_options4.rb', line 83

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    auth_type
    verbal_auth_code
    verbal_auth_transaction_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
# File 'lib/visa_acceptance_merged_spec/models/authorization_options4.rb', line 135

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

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
132
# File 'lib/visa_acceptance_merged_spec/models/authorization_options4.rb', line 127

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