apimatic-polpay-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +173 -0
  4. data/bin/console +15 -0
  5. data/lib/poli_ap_is/api_helper.rb +10 -0
  6. data/lib/poli_ap_is/apis/base_api.rb +67 -0
  7. data/lib/poli_ap_is/apis/payments_api.rb +155 -0
  8. data/lib/poli_ap_is/apis/poli_links_api.rb +135 -0
  9. data/lib/poli_ap_is/client.rb +79 -0
  10. data/lib/poli_ap_is/configuration.rb +179 -0
  11. data/lib/poli_ap_is/exceptions/api_exception.rb +21 -0
  12. data/lib/poli_ap_is/http/api_response.rb +19 -0
  13. data/lib/poli_ap_is/http/auth/basic_auth.rb +62 -0
  14. data/lib/poli_ap_is/http/http_call_back.rb +10 -0
  15. data/lib/poli_ap_is/http/http_method_enum.rb +10 -0
  16. data/lib/poli_ap_is/http/http_request.rb +10 -0
  17. data/lib/poli_ap_is/http/http_response.rb +10 -0
  18. data/lib/poli_ap_is/http/proxy_settings.rb +22 -0
  19. data/lib/poli_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
  20. data/lib/poli_ap_is/logging/sdk_logger.rb +17 -0
  21. data/lib/poli_ap_is/models/bank_details.rb +126 -0
  22. data/lib/poli_ap_is/models/base_model.rb +110 -0
  23. data/lib/poli_ap_is/models/create_poli_link_request.rb +170 -0
  24. data/lib/poli_ap_is/models/create_poli_link_request_body_json.rb +170 -0
  25. data/lib/poli_ap_is/models/daily_transaction.rb +245 -0
  26. data/lib/poli_ap_is/models/fetch_statusof_poli_link_response200_text.rb +48 -0
  27. data/lib/poli_ap_is/models/financial_institution.rb +95 -0
  28. data/lib/poli_ap_is/models/get_transaction_response.rb +109 -0
  29. data/lib/poli_ap_is/models/initiate_transaction_request.rb +201 -0
  30. data/lib/poli_ap_is/models/initiate_transaction_response.rb +118 -0
  31. data/lib/poli_ap_is/models/link_payment.rb +137 -0
  32. data/lib/poli_ap_is/models/merchant_details.rb +100 -0
  33. data/lib/poli_ap_is/models/payer_details.rb +100 -0
  34. data/lib/poli_ap_is/models/poli_link_basic_info.rb +116 -0
  35. data/lib/poli_ap_is/models/poli_link_basic_info_status.rb +48 -0
  36. data/lib/poli_ap_is/models/poli_link_payments_response.rb +116 -0
  37. data/lib/poli_ap_is/models/poli_link_payments_response_status.rb +48 -0
  38. data/lib/poli_ap_is/models/poli_link_payments_response_transactions_items.rb +159 -0
  39. data/lib/poli_ap_is/models/transaction_details.rb +148 -0
  40. data/lib/poli_ap_is/utilities/date_time_helper.rb +11 -0
  41. data/lib/poli_ap_is/utilities/file_wrapper.rb +28 -0
  42. data/lib/poli_ap_is.rb +64 -0
  43. metadata +126 -0
@@ -0,0 +1,48 @@
1
+ # poli_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module PoliApIs
7
+ # FetchStatusofPOLiLinkResponse200Text.
8
+ class FetchStatusofPoliLinkResponse200Text
9
+ FETCH_STATUSOF_POLI_LINK_RESPONSE200_TEXT = [
10
+ # TODO: Write general description for UNUSED
11
+ UNUSED = 'Unused'.freeze,
12
+
13
+ # TODO: Write general description for ACTIVATED
14
+ ACTIVATED = 'Activated'.freeze,
15
+
16
+ # TODO: Write general description for PARTPAID
17
+ PARTPAID = 'PartPaid'.freeze,
18
+
19
+ # TODO: Write general description for FUTURE
20
+ FUTURE = 'Future'.freeze,
21
+
22
+ # TODO: Write general description for COMPLETED
23
+ COMPLETED = 'Completed'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ FETCH_STATUSOF_POLI_LINK_RESPONSE200_TEXT.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = UNUSED)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'unused' then UNUSED
39
+ when 'activated' then ACTIVATED
40
+ when 'partpaid' then PARTPAID
41
+ when 'future' then FUTURE
42
+ when 'completed' then COMPLETED
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,95 @@
1
+ # poli_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module PoliApIs
7
+ # FinancialInstitution Model.
8
+ class FinancialInstitution < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The name of the financial institution
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # The code of the financial institution
17
+ # @return [String]
18
+ attr_accessor :code
19
+
20
+ # Indicates whether the financial institution is online
21
+ # @return [TrueClass | FalseClass]
22
+ attr_accessor :online
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['name'] = 'Name'
28
+ @_hash['code'] = 'Code'
29
+ @_hash['online'] = 'Online'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ name
37
+ code
38
+ online
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(name: SKIP, code: SKIP, online: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @name = name unless name == SKIP
53
+ @code = code unless code == SKIP
54
+ @online = online unless online == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ name = hash.key?('Name') ? hash['Name'] : SKIP
64
+ code = hash.key?('Code') ? hash['Code'] : SKIP
65
+ online = hash.key?('Online') ? hash['Online'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ FinancialInstitution.new(name: name,
76
+ code: code,
77
+ online: online,
78
+ additional_properties: additional_properties)
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} name: #{@name}, code: #{@code}, online: #{@online}, additional_properties:"\
85
+ " #{@additional_properties}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} name: #{@name.inspect}, code: #{@code.inspect}, online: #{@online.inspect},"\
92
+ " additional_properties: #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,109 @@
1
+ # poli_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module PoliApIs
7
+ # GetTransactionResponse Model.
8
+ class GetTransactionResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [TransactionDetails]
14
+ attr_accessor :transaction_details
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [BankDetails]
18
+ attr_accessor :bank_details
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [MerchantDetails]
22
+ attr_accessor :merchant_details
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [PayerDetails]
26
+ attr_accessor :payer_details
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['transaction_details'] = 'TransactionDetails'
32
+ @_hash['bank_details'] = 'BankDetails'
33
+ @_hash['merchant_details'] = 'MerchantDetails'
34
+ @_hash['payer_details'] = 'PayerDetails'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ transaction_details
42
+ bank_details
43
+ merchant_details
44
+ payer_details
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(transaction_details: SKIP, bank_details: SKIP,
54
+ merchant_details: SKIP, payer_details: SKIP,
55
+ additional_properties: nil)
56
+ # Add additional model properties to the instance
57
+ additional_properties = {} if additional_properties.nil?
58
+
59
+ @transaction_details = transaction_details unless transaction_details == SKIP
60
+ @bank_details = bank_details unless bank_details == SKIP
61
+ @merchant_details = merchant_details unless merchant_details == SKIP
62
+ @payer_details = payer_details unless payer_details == SKIP
63
+ @additional_properties = additional_properties
64
+ end
65
+
66
+ # Creates an instance of the object from a hash.
67
+ def self.from_hash(hash)
68
+ return nil unless hash
69
+
70
+ # Extract variables from the hash.
71
+ transaction_details = TransactionDetails.from_hash(hash['TransactionDetails']) if
72
+ hash['TransactionDetails']
73
+ bank_details = BankDetails.from_hash(hash['BankDetails']) if hash['BankDetails']
74
+ merchant_details = MerchantDetails.from_hash(hash['MerchantDetails']) if
75
+ hash['MerchantDetails']
76
+ payer_details = PayerDetails.from_hash(hash['PayerDetails']) if hash['PayerDetails']
77
+
78
+ # Create a new hash for additional properties, removing known properties.
79
+ new_hash = hash.reject { |k, _| names.value?(k) }
80
+
81
+ additional_properties = APIHelper.get_additional_properties(
82
+ new_hash, proc { |value| value }
83
+ )
84
+
85
+ # Create object from extracted values.
86
+ GetTransactionResponse.new(transaction_details: transaction_details,
87
+ bank_details: bank_details,
88
+ merchant_details: merchant_details,
89
+ payer_details: payer_details,
90
+ additional_properties: additional_properties)
91
+ end
92
+
93
+ # Provides a human-readable string representation of the object.
94
+ def to_s
95
+ class_name = self.class.name.split('::').last
96
+ "<#{class_name} transaction_details: #{@transaction_details}, bank_details:"\
97
+ " #{@bank_details}, merchant_details: #{@merchant_details}, payer_details:"\
98
+ " #{@payer_details}, additional_properties: #{@additional_properties}>"
99
+ end
100
+
101
+ # Provides a debugging-friendly string with detailed object information.
102
+ def inspect
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} transaction_details: #{@transaction_details.inspect}, bank_details:"\
105
+ " #{@bank_details.inspect}, merchant_details: #{@merchant_details.inspect}, payer_details:"\
106
+ " #{@payer_details.inspect}, additional_properties: #{@additional_properties}>"
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,201 @@
1
+ # poli_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module PoliApIs
7
+ # InitiateTransactionRequest Model.
8
+ class InitiateTransactionRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The transaction amount the customer should be charged. Value up to 2
13
+ # decimal places.
14
+ # @return [Float]
15
+ attr_accessor :amount
16
+
17
+ # The currency of the transaction. Typically a 3-character code.
18
+ # @return [String]
19
+ attr_accessor :currency_code
20
+
21
+ # Unique reference specified by the merchant for the transaction. Special
22
+ # characters will be replaced with spaces in the bank field.
23
+ # @return [String]
24
+ attr_accessor :merchant_reference
25
+
26
+ # Specifies a reconciliation format (used for NZ reconciliation).
27
+ # @return [String]
28
+ attr_accessor :merchant_reference_format
29
+
30
+ # Merchant-specified information carried along with the transaction for
31
+ # internal use post-transaction.
32
+ # @return [String]
33
+ attr_accessor :merchant_data
34
+
35
+ # Complete URL displayed on the POLi landing page.
36
+ # @return [String]
37
+ attr_accessor :merchant_homepage_url
38
+
39
+ # Complete URL to redirect the customer to if the transaction is successful.
40
+ # The transaction token will be appended as a query parameter.
41
+ # @return [String]
42
+ attr_accessor :success_url
43
+
44
+ # Complete URL to redirect the customer to if the transaction is not
45
+ # successful. The transaction token will be appended as a query parameter.
46
+ # @return [String]
47
+ attr_accessor :failure_url
48
+
49
+ # Complete URL to redirect the customer to if they cancel the transaction.
50
+ # The transaction token will be appended as a query parameter.
51
+ # @return [String]
52
+ attr_accessor :cancellation_url
53
+
54
+ # URL where POLi will deliver the Nudge POST when the transaction reaches a
55
+ # terminal state.
56
+ # @return [String]
57
+ attr_accessor :notification_url
58
+
59
+ # Timeout for the transaction in seconds. Defaults to 900 (15 minutes).
60
+ # @return [Integer]
61
+ attr_accessor :timeout
62
+
63
+ # Pre-selects a bank to skip the POLi landing page.
64
+ # @return [String]
65
+ attr_accessor :selected_fi_code
66
+
67
+ # A mapping from model property names to API property names.
68
+ def self.names
69
+ @_hash = {} if @_hash.nil?
70
+ @_hash['amount'] = 'Amount'
71
+ @_hash['currency_code'] = 'CurrencyCode'
72
+ @_hash['merchant_reference'] = 'MerchantReference'
73
+ @_hash['merchant_reference_format'] = 'MerchantReferenceFormat'
74
+ @_hash['merchant_data'] = 'MerchantData'
75
+ @_hash['merchant_homepage_url'] = 'MerchantHomepageURL'
76
+ @_hash['success_url'] = 'SuccessURL'
77
+ @_hash['failure_url'] = 'FailureURL'
78
+ @_hash['cancellation_url'] = 'CancellationURL'
79
+ @_hash['notification_url'] = 'NotificationURL'
80
+ @_hash['timeout'] = 'Timeout'
81
+ @_hash['selected_fi_code'] = 'SelectedFICode'
82
+ @_hash
83
+ end
84
+
85
+ # An array for optional fields
86
+ def self.optionals
87
+ %w[
88
+ merchant_reference_format
89
+ merchant_data
90
+ failure_url
91
+ cancellation_url
92
+ notification_url
93
+ timeout
94
+ selected_fi_code
95
+ ]
96
+ end
97
+
98
+ # An array for nullable fields
99
+ def self.nullables
100
+ []
101
+ end
102
+
103
+ def initialize(amount:, currency_code:, merchant_reference:,
104
+ merchant_homepage_url:, success_url:,
105
+ merchant_reference_format: SKIP, merchant_data: SKIP,
106
+ failure_url: SKIP, cancellation_url: SKIP,
107
+ notification_url: SKIP, timeout: SKIP,
108
+ selected_fi_code: SKIP, additional_properties: nil)
109
+ # Add additional model properties to the instance
110
+ additional_properties = {} if additional_properties.nil?
111
+
112
+ @amount = amount
113
+ @currency_code = currency_code
114
+ @merchant_reference = merchant_reference
115
+ unless merchant_reference_format == SKIP
116
+ @merchant_reference_format =
117
+ merchant_reference_format
118
+ end
119
+ @merchant_data = merchant_data unless merchant_data == SKIP
120
+ @merchant_homepage_url = merchant_homepage_url
121
+ @success_url = success_url
122
+ @failure_url = failure_url unless failure_url == SKIP
123
+ @cancellation_url = cancellation_url unless cancellation_url == SKIP
124
+ @notification_url = notification_url unless notification_url == SKIP
125
+ @timeout = timeout unless timeout == SKIP
126
+ @selected_fi_code = selected_fi_code unless selected_fi_code == SKIP
127
+ @additional_properties = additional_properties
128
+ end
129
+
130
+ # Creates an instance of the object from a hash.
131
+ def self.from_hash(hash)
132
+ return nil unless hash
133
+
134
+ # Extract variables from the hash.
135
+ amount = hash.key?('Amount') ? hash['Amount'] : nil
136
+ currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : nil
137
+ merchant_reference =
138
+ hash.key?('MerchantReference') ? hash['MerchantReference'] : nil
139
+ merchant_homepage_url =
140
+ hash.key?('MerchantHomepageURL') ? hash['MerchantHomepageURL'] : nil
141
+ success_url = hash.key?('SuccessURL') ? hash['SuccessURL'] : nil
142
+ merchant_reference_format =
143
+ hash.key?('MerchantReferenceFormat') ? hash['MerchantReferenceFormat'] : SKIP
144
+ merchant_data = hash.key?('MerchantData') ? hash['MerchantData'] : SKIP
145
+ failure_url = hash.key?('FailureURL') ? hash['FailureURL'] : SKIP
146
+ cancellation_url =
147
+ hash.key?('CancellationURL') ? hash['CancellationURL'] : SKIP
148
+ notification_url =
149
+ hash.key?('NotificationURL') ? hash['NotificationURL'] : SKIP
150
+ timeout = hash.key?('Timeout') ? hash['Timeout'] : SKIP
151
+ selected_fi_code =
152
+ hash.key?('SelectedFICode') ? hash['SelectedFICode'] : SKIP
153
+
154
+ # Create a new hash for additional properties, removing known properties.
155
+ new_hash = hash.reject { |k, _| names.value?(k) }
156
+
157
+ additional_properties = APIHelper.get_additional_properties(
158
+ new_hash, proc { |value| value }
159
+ )
160
+
161
+ # Create object from extracted values.
162
+ InitiateTransactionRequest.new(amount: amount,
163
+ currency_code: currency_code,
164
+ merchant_reference: merchant_reference,
165
+ merchant_homepage_url: merchant_homepage_url,
166
+ success_url: success_url,
167
+ merchant_reference_format: merchant_reference_format,
168
+ merchant_data: merchant_data,
169
+ failure_url: failure_url,
170
+ cancellation_url: cancellation_url,
171
+ notification_url: notification_url,
172
+ timeout: timeout,
173
+ selected_fi_code: selected_fi_code,
174
+ additional_properties: additional_properties)
175
+ end
176
+
177
+ # Provides a human-readable string representation of the object.
178
+ def to_s
179
+ class_name = self.class.name.split('::').last
180
+ "<#{class_name} amount: #{@amount}, currency_code: #{@currency_code}, merchant_reference:"\
181
+ " #{@merchant_reference}, merchant_reference_format: #{@merchant_reference_format},"\
182
+ " merchant_data: #{@merchant_data}, merchant_homepage_url: #{@merchant_homepage_url},"\
183
+ " success_url: #{@success_url}, failure_url: #{@failure_url}, cancellation_url:"\
184
+ " #{@cancellation_url}, notification_url: #{@notification_url}, timeout: #{@timeout},"\
185
+ " selected_fi_code: #{@selected_fi_code}, additional_properties: #{@additional_properties}>"
186
+ end
187
+
188
+ # Provides a debugging-friendly string with detailed object information.
189
+ def inspect
190
+ class_name = self.class.name.split('::').last
191
+ "<#{class_name} amount: #{@amount.inspect}, currency_code: #{@currency_code.inspect},"\
192
+ " merchant_reference: #{@merchant_reference.inspect}, merchant_reference_format:"\
193
+ " #{@merchant_reference_format.inspect}, merchant_data: #{@merchant_data.inspect},"\
194
+ " merchant_homepage_url: #{@merchant_homepage_url.inspect}, success_url:"\
195
+ " #{@success_url.inspect}, failure_url: #{@failure_url.inspect}, cancellation_url:"\
196
+ " #{@cancellation_url.inspect}, notification_url: #{@notification_url.inspect}, timeout:"\
197
+ " #{@timeout.inspect}, selected_fi_code: #{@selected_fi_code.inspect},"\
198
+ " additional_properties: #{@additional_properties}>"
199
+ end
200
+ end
201
+ end
@@ -0,0 +1,118 @@
1
+ # poli_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module PoliApIs
7
+ # InitiateTransactionResponse Model.
8
+ class InitiateTransactionResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Indicates if the transaction was successful.
13
+ # @return [TrueClass | FalseClass]
14
+ attr_accessor :success
15
+
16
+ # The URL to redirect the customer to proceed with the payment.
17
+ # @return [String]
18
+ attr_accessor :navigate_url
19
+
20
+ # Error code if the transaction failed.
21
+ # @return [Integer]
22
+ attr_accessor :error_code
23
+
24
+ # Error message if the transaction failed.
25
+ # @return [String]
26
+ attr_accessor :error_message
27
+
28
+ # Reference number for the transaction.
29
+ # @return [String]
30
+ attr_accessor :transaction_ref_no
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['success'] = 'Success'
36
+ @_hash['navigate_url'] = 'NavigateURL'
37
+ @_hash['error_code'] = 'ErrorCode'
38
+ @_hash['error_message'] = 'ErrorMessage'
39
+ @_hash['transaction_ref_no'] = 'TransactionRefNo'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ success
47
+ navigate_url
48
+ error_code
49
+ error_message
50
+ transaction_ref_no
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(success: SKIP, navigate_url: SKIP, error_code: SKIP,
60
+ error_message: SKIP, transaction_ref_no: SKIP,
61
+ additional_properties: nil)
62
+ # Add additional model properties to the instance
63
+ additional_properties = {} if additional_properties.nil?
64
+
65
+ @success = success unless success == SKIP
66
+ @navigate_url = navigate_url unless navigate_url == SKIP
67
+ @error_code = error_code unless error_code == SKIP
68
+ @error_message = error_message unless error_message == SKIP
69
+ @transaction_ref_no = transaction_ref_no unless transaction_ref_no == SKIP
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ success = hash.key?('Success') ? hash['Success'] : SKIP
79
+ navigate_url = hash.key?('NavigateURL') ? hash['NavigateURL'] : SKIP
80
+ error_code = hash.key?('ErrorCode') ? hash['ErrorCode'] : SKIP
81
+ error_message = hash.key?('ErrorMessage') ? hash['ErrorMessage'] : SKIP
82
+ transaction_ref_no =
83
+ hash.key?('TransactionRefNo') ? hash['TransactionRefNo'] : SKIP
84
+
85
+ # Create a new hash for additional properties, removing known properties.
86
+ new_hash = hash.reject { |k, _| names.value?(k) }
87
+
88
+ additional_properties = APIHelper.get_additional_properties(
89
+ new_hash, proc { |value| value }
90
+ )
91
+
92
+ # Create object from extracted values.
93
+ InitiateTransactionResponse.new(success: success,
94
+ navigate_url: navigate_url,
95
+ error_code: error_code,
96
+ error_message: error_message,
97
+ transaction_ref_no: transaction_ref_no,
98
+ additional_properties: additional_properties)
99
+ end
100
+
101
+ # Provides a human-readable string representation of the object.
102
+ def to_s
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} success: #{@success}, navigate_url: #{@navigate_url}, error_code:"\
105
+ " #{@error_code}, error_message: #{@error_message}, transaction_ref_no:"\
106
+ " #{@transaction_ref_no}, additional_properties: #{@additional_properties}>"
107
+ end
108
+
109
+ # Provides a debugging-friendly string with detailed object information.
110
+ def inspect
111
+ class_name = self.class.name.split('::').last
112
+ "<#{class_name} success: #{@success.inspect}, navigate_url: #{@navigate_url.inspect},"\
113
+ " error_code: #{@error_code.inspect}, error_message: #{@error_message.inspect},"\
114
+ " transaction_ref_no: #{@transaction_ref_no.inspect}, additional_properties:"\
115
+ " #{@additional_properties}>"
116
+ end
117
+ end
118
+ end