Class: SplititWebApiV4::PlanAuthorizationData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/splitit_web_api_v4/models/plan_authorization_data.rb

Overview

PlanAuthorizationData 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(status:, date: SKIP, splitit_error_result_code: SKIP, gateway_transaction_id: SKIP, gateway_result_code: SKIP, gateway_result_message: SKIP, three_ds_redirect: SKIP, cavv: SKIP, eci: SKIP, gateway_source_response: SKIP, additional_properties: nil) ⇒ PlanAuthorizationData

Returns a new instance of PlanAuthorizationData.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 89

def initialize(status:, date: SKIP, splitit_error_result_code: SKIP,
               gateway_transaction_id: SKIP, gateway_result_code: SKIP,
               gateway_result_message: SKIP, three_ds_redirect: SKIP,
               cavv: SKIP, eci: SKIP, gateway_source_response: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status
  @date = date unless date == SKIP
  unless splitit_error_result_code == SKIP
    @splitit_error_result_code =
      splitit_error_result_code
  end
  @gateway_transaction_id = gateway_transaction_id unless gateway_transaction_id == SKIP
  @gateway_result_code = gateway_result_code unless gateway_result_code == SKIP
  @gateway_result_message = gateway_result_message unless gateway_result_message == SKIP
  @three_ds_redirect = three_ds_redirect unless three_ds_redirect == SKIP
  @cavv = cavv unless cavv == SKIP
  @eci = eci unless eci == SKIP
  @gateway_source_response = gateway_source_response unless gateway_source_response == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#cavvString

TODO: Write general description for this method

Returns:

  • (String)


43
44
45
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 43

def cavv
  @cavv
end

#dateDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


19
20
21
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 19

def date
  @date
end

#eciString

TODO: Write general description for this method

Returns:

  • (String)


47
48
49
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 47

def eci
  @eci
end

#gateway_result_codeString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 31

def gateway_result_code
  @gateway_result_code
end

#gateway_result_messageString

TODO: Write general description for this method

Returns:

  • (String)


35
36
37
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 35

def gateway_result_message
  @gateway_result_message
end

#gateway_source_responseString

TODO: Write general description for this method

Returns:

  • (String)


51
52
53
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 51

def gateway_source_response
  @gateway_source_response
end

#gateway_transaction_idString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 27

def gateway_transaction_id
  @gateway_transaction_id
end

#splitit_error_result_codeString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 23

def splitit_error_result_code
  @splitit_error_result_code
end

#statusInstallmentStatus

TODO: Write general description for this method

Returns:



15
16
17
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 15

def status
  @status
end

#three_ds_redirectThreeDsRedirectData

TODO: Write general description for this method

Returns:



39
40
41
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 39

def three_ds_redirect
  @three_ds_redirect
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 114

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('Status') ? hash['Status'] : nil
  date = if hash.key?('Date')
           (DateTimeHelper.from_rfc3339(hash['Date']) if hash['Date'])
         else
           SKIP
         end
  splitit_error_result_code =
    hash.key?('SplititErrorResultCode') ? hash['SplititErrorResultCode'] : SKIP
  gateway_transaction_id =
    hash.key?('GatewayTransactionID') ? hash['GatewayTransactionID'] : SKIP
  gateway_result_code =
    hash.key?('GatewayResultCode') ? hash['GatewayResultCode'] : SKIP
  gateway_result_message =
    hash.key?('GatewayResultMessage') ? hash['GatewayResultMessage'] : SKIP
  three_ds_redirect = ThreeDsRedirectData.from_hash(hash['ThreeDSRedirect']) if
    hash['ThreeDSRedirect']
  cavv = hash.key?('CAVV') ? hash['CAVV'] : SKIP
  eci = hash.key?('ECI') ? hash['ECI'] : SKIP
  gateway_source_response =
    hash.key?('GatewaySourceResponse') ? hash['GatewaySourceResponse'] : 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.
  PlanAuthorizationData.new(status: status,
                            date: date,
                            splitit_error_result_code: splitit_error_result_code,
                            gateway_transaction_id: gateway_transaction_id,
                            gateway_result_code: gateway_result_code,
                            gateway_result_message: gateway_result_message,
                            three_ds_redirect: three_ds_redirect,
                            cavv: cavv,
                            eci: eci,
                            gateway_source_response: gateway_source_response,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'Status'
  @_hash['date'] = 'Date'
  @_hash['splitit_error_result_code'] = 'SplititErrorResultCode'
  @_hash['gateway_transaction_id'] = 'GatewayTransactionID'
  @_hash['gateway_result_code'] = 'GatewayResultCode'
  @_hash['gateway_result_message'] = 'GatewayResultMessage'
  @_hash['three_ds_redirect'] = 'ThreeDSRedirect'
  @_hash['cavv'] = 'CAVV'
  @_hash['eci'] = 'ECI'
  @_hash['gateway_source_response'] = 'GatewaySourceResponse'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 85

def self.nullables
  []
end

.optionalsObject

An array for optional fields



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 70

def self.optionals
  %w[
    date
    splitit_error_result_code
    gateway_transaction_id
    gateway_result_code
    gateway_result_message
    three_ds_redirect
    cavv
    eci
    gateway_source_response
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



176
177
178
179
180
181
182
183
184
185
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 176

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, date: #{@date.inspect},"\
  " splitit_error_result_code: #{@splitit_error_result_code.inspect}, gateway_transaction_id:"\
  " #{@gateway_transaction_id.inspect}, gateway_result_code: #{@gateway_result_code.inspect},"\
  " gateway_result_message: #{@gateway_result_message.inspect}, three_ds_redirect:"\
  " #{@three_ds_redirect.inspect}, cavv: #{@cavv.inspect}, eci: #{@eci.inspect},"\
  " gateway_source_response: #{@gateway_source_response.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_dateObject



160
161
162
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 160

def to_custom_date
  DateTimeHelper.to_rfc3339(date)
end

#to_sObject

Provides a human-readable string representation of the object.



165
166
167
168
169
170
171
172
173
# File 'lib/splitit_web_api_v4/models/plan_authorization_data.rb', line 165

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, date: #{@date}, splitit_error_result_code:"\
  " #{@splitit_error_result_code}, gateway_transaction_id: #{@gateway_transaction_id},"\
  " gateway_result_code: #{@gateway_result_code}, gateway_result_message:"\
  " #{@gateway_result_message}, three_ds_redirect: #{@three_ds_redirect}, cavv: #{@cavv}, eci:"\
  " #{@eci}, gateway_source_response: #{@gateway_source_response}, additional_properties:"\
  " #{@additional_properties}>"
end