payzu-pix 2.0.0

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 (172) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +231 -0
  4. data/Rakefile +10 -0
  5. data/docs/AccountApi.md +141 -0
  6. data/docs/ApiErrorDetailsInner.md +20 -0
  7. data/docs/BankStatement.md +42 -0
  8. data/docs/BankStatementListResponse.md +20 -0
  9. data/docs/BankStatementListResponsePagination.md +22 -0
  10. data/docs/CallbackDetail.md +34 -0
  11. data/docs/CallbackListResponse.md +20 -0
  12. data/docs/CallbackListResponsePagination.md +22 -0
  13. data/docs/CallbackSecretResponse.md +20 -0
  14. data/docs/CallbacksApi.md +587 -0
  15. data/docs/Defense.md +30 -0
  16. data/docs/DefenseFilesInner.md +24 -0
  17. data/docs/DefenseHistoryEntry.md +28 -0
  18. data/docs/DefenseHistoryEntryFilesInner.md +22 -0
  19. data/docs/DepositPending.md +62 -0
  20. data/docs/DepositPendingListResponse.md +24 -0
  21. data/docs/DictConsultResponse.md +30 -0
  22. data/docs/DownloadUserReport200Response.md +20 -0
  23. data/docs/EnqueuedCallback.md +18 -0
  24. data/docs/EnqueuedCallbackEnqueued.md +22 -0
  25. data/docs/EnqueuedCallbackItem.md +22 -0
  26. data/docs/ErrorResponse.md +32 -0
  27. data/docs/GetUser200Response.md +46 -0
  28. data/docs/GetUser200ResponseDailyWithdrawLimit.md +24 -0
  29. data/docs/GetUser200ResponseServiceFee.md +28 -0
  30. data/docs/GetUserBalance200Response.md +20 -0
  31. data/docs/GetUserTransactionById200Response.md +94 -0
  32. data/docs/GetUserTransactionById200ResponseAllOfCallbackLogInner.md +26 -0
  33. data/docs/GetUserTransactionById200ResponseAllOfInfractionInner.md +24 -0
  34. data/docs/GetUserTransactions200Response.md +22 -0
  35. data/docs/InfractionDetail.md +40 -0
  36. data/docs/InfractionDetailTransaction.md +30 -0
  37. data/docs/InfractionListResponse.md +20 -0
  38. data/docs/InfractionListResponsePagination.md +24 -0
  39. data/docs/InfractionsApi.md +413 -0
  40. data/docs/InternalTransferApi.md +153 -0
  41. data/docs/KeysAndDICTApi.md +217 -0
  42. data/docs/ListUserReports200Response.md +22 -0
  43. data/docs/PixKeyInfo.md +36 -0
  44. data/docs/PixOperationsApi.md +299 -0
  45. data/docs/PostInternalTransferRequest.md +30 -0
  46. data/docs/PostPixQrcodeReadRequest.md +18 -0
  47. data/docs/PostPixRequest.md +32 -0
  48. data/docs/PostUserReportRequest.md +24 -0
  49. data/docs/PostWithdrawQrcodeRequest.md +28 -0
  50. data/docs/PostWithdrawRequest.md +30 -0
  51. data/docs/ProofResponse.md +18 -0
  52. data/docs/QRCodeReadResponse.md +38 -0
  53. data/docs/Refund.md +34 -0
  54. data/docs/RefundRequest.md +22 -0
  55. data/docs/RefundsApi.md +79 -0
  56. data/docs/ReportJob.md +30 -0
  57. data/docs/ReportJobAccepted.md +30 -0
  58. data/docs/ReportJobDetail.md +30 -0
  59. data/docs/ReportsApi.md +881 -0
  60. data/docs/ResendUserCallbackSingle200Response.md +18 -0
  61. data/docs/ResendUserCallbacks200Response.md +20 -0
  62. data/docs/ResendUserCallbacksRequest.md +28 -0
  63. data/docs/ResendWebhookCallbacksRequest.md +30 -0
  64. data/docs/RotateCallbackSecretResponse.md +18 -0
  65. data/docs/RotateSecretResponse.md +18 -0
  66. data/docs/SentWebhookDetail.md +40 -0
  67. data/docs/SentWebhookDetailResponse.md +18 -0
  68. data/docs/SentWebhooksQuantity.md +18 -0
  69. data/docs/Summary.md +26 -0
  70. data/docs/SummaryBlock.md +24 -0
  71. data/docs/SummaryBlockGroupedInner.md +20 -0
  72. data/docs/SummaryBlockStatuses.md +26 -0
  73. data/docs/SummaryStatus.md +22 -0
  74. data/docs/Transaction.md +90 -0
  75. data/docs/TransactionWithRefunds.md +92 -0
  76. data/docs/Webhook.md +30 -0
  77. data/docs/WebhookCreateRequest.md +24 -0
  78. data/docs/WebhookEventType.md +15 -0
  79. data/docs/WebhookListResponse.md +18 -0
  80. data/docs/WebhookUpdateRequest.md +22 -0
  81. data/docs/WebhookWithSecret.md +32 -0
  82. data/docs/WebhooksApi.md +574 -0
  83. data/docs/WithdrawalsApi.md +299 -0
  84. data/git_push.sh +57 -0
  85. data/lib/payzu-pix/api/account_api.rb +136 -0
  86. data/lib/payzu-pix/api/callbacks_api.rb +577 -0
  87. data/lib/payzu-pix/api/infractions_api.rb +452 -0
  88. data/lib/payzu-pix/api/internal_transfer_api.rb +164 -0
  89. data/lib/payzu-pix/api/keys_and_dict_api.rb +234 -0
  90. data/lib/payzu-pix/api/pix_operations_api.rb +300 -0
  91. data/lib/payzu-pix/api/refunds_api.rb +96 -0
  92. data/lib/payzu-pix/api/reports_api.rb +968 -0
  93. data/lib/payzu-pix/api/webhooks_api.rb +542 -0
  94. data/lib/payzu-pix/api/withdrawals_api.rb +305 -0
  95. data/lib/payzu-pix/api_client.rb +441 -0
  96. data/lib/payzu-pix/api_error.rb +58 -0
  97. data/lib/payzu-pix/api_model_base.rb +88 -0
  98. data/lib/payzu-pix/configuration.rb +392 -0
  99. data/lib/payzu-pix/models/api_error_details_inner.rb +192 -0
  100. data/lib/payzu-pix/models/bank_statement.rb +296 -0
  101. data/lib/payzu-pix/models/bank_statement_list_response.rb +159 -0
  102. data/lib/payzu-pix/models/bank_statement_list_response_pagination.rb +169 -0
  103. data/lib/payzu-pix/models/callback_detail.rb +228 -0
  104. data/lib/payzu-pix/models/callback_list_response.rb +159 -0
  105. data/lib/payzu-pix/models/callback_list_response_pagination.rb +169 -0
  106. data/lib/payzu-pix/models/callback_secret_response.rb +158 -0
  107. data/lib/payzu-pix/models/defense.rb +234 -0
  108. data/lib/payzu-pix/models/defense_files_inner.rb +179 -0
  109. data/lib/payzu-pix/models/defense_history_entry.rb +225 -0
  110. data/lib/payzu-pix/models/defense_history_entry_files_inner.rb +168 -0
  111. data/lib/payzu-pix/models/deposit_pending.rb +407 -0
  112. data/lib/payzu-pix/models/deposit_pending_list_response.rb +180 -0
  113. data/lib/payzu-pix/models/dict_consult_response.rb +231 -0
  114. data/lib/payzu-pix/models/download_user_report200_response.rb +158 -0
  115. data/lib/payzu-pix/models/enqueued_callback.rb +147 -0
  116. data/lib/payzu-pix/models/enqueued_callback_enqueued.rb +170 -0
  117. data/lib/payzu-pix/models/enqueued_callback_item.rb +190 -0
  118. data/lib/payzu-pix/models/error_response.rb +336 -0
  119. data/lib/payzu-pix/models/get_user200_response.rb +334 -0
  120. data/lib/payzu-pix/models/get_user200_response_daily_withdraw_limit.rb +180 -0
  121. data/lib/payzu-pix/models/get_user200_response_service_fee.rb +199 -0
  122. data/lib/payzu-pix/models/get_user_balance200_response.rb +158 -0
  123. data/lib/payzu-pix/models/get_user_transaction_by_id200_response.rb +595 -0
  124. data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_callback_log_inner.rb +188 -0
  125. data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_infraction_inner.rb +202 -0
  126. data/lib/payzu-pix/models/get_user_transactions200_response.rb +170 -0
  127. data/lib/payzu-pix/models/infraction_detail.rb +293 -0
  128. data/lib/payzu-pix/models/infraction_detail_transaction.rb +213 -0
  129. data/lib/payzu-pix/models/infraction_list_response.rb +159 -0
  130. data/lib/payzu-pix/models/infraction_list_response_pagination.rb +179 -0
  131. data/lib/payzu-pix/models/list_user_reports200_response.rb +170 -0
  132. data/lib/payzu-pix/models/pix_key_info.rb +263 -0
  133. data/lib/payzu-pix/models/post_internal_transfer_request.rb +377 -0
  134. data/lib/payzu-pix/models/post_pix_qrcode_read_request.rb +174 -0
  135. data/lib/payzu-pix/models/post_pix_request.rb +382 -0
  136. data/lib/payzu-pix/models/post_user_report_request.rb +238 -0
  137. data/lib/payzu-pix/models/post_withdraw_qrcode_request.rb +302 -0
  138. data/lib/payzu-pix/models/post_withdraw_request.rb +350 -0
  139. data/lib/payzu-pix/models/proof_response.rb +148 -0
  140. data/lib/payzu-pix/models/qr_code_read_response.rb +283 -0
  141. data/lib/payzu-pix/models/refund.rb +257 -0
  142. data/lib/payzu-pix/models/refund_request.rb +215 -0
  143. data/lib/payzu-pix/models/report_job.rb +234 -0
  144. data/lib/payzu-pix/models/report_job_accepted.rb +237 -0
  145. data/lib/payzu-pix/models/report_job_detail.rb +237 -0
  146. data/lib/payzu-pix/models/resend_user_callback_single200_response.rb +148 -0
  147. data/lib/payzu-pix/models/resend_user_callbacks200_response.rb +158 -0
  148. data/lib/payzu-pix/models/resend_user_callbacks_request.rb +262 -0
  149. data/lib/payzu-pix/models/resend_webhook_callbacks_request.rb +274 -0
  150. data/lib/payzu-pix/models/rotate_callback_secret_response.rb +148 -0
  151. data/lib/payzu-pix/models/rotate_secret_response.rb +148 -0
  152. data/lib/payzu-pix/models/sent_webhook_detail.rb +261 -0
  153. data/lib/payzu-pix/models/sent_webhook_detail_response.rb +164 -0
  154. data/lib/payzu-pix/models/sent_webhooks_quantity.rb +148 -0
  155. data/lib/payzu-pix/models/summary.rb +188 -0
  156. data/lib/payzu-pix/models/summary_block.rb +179 -0
  157. data/lib/payzu-pix/models/summary_block_grouped_inner.rb +158 -0
  158. data/lib/payzu-pix/models/summary_block_statuses.rb +189 -0
  159. data/lib/payzu-pix/models/summary_status.rb +168 -0
  160. data/lib/payzu-pix/models/transaction.rb +588 -0
  161. data/lib/payzu-pix/models/transaction_with_refunds.rb +583 -0
  162. data/lib/payzu-pix/models/webhook.rb +210 -0
  163. data/lib/payzu-pix/models/webhook_create_request.rb +201 -0
  164. data/lib/payzu-pix/models/webhook_event_type.rb +47 -0
  165. data/lib/payzu-pix/models/webhook_list_response.rb +150 -0
  166. data/lib/payzu-pix/models/webhook_update_request.rb +171 -0
  167. data/lib/payzu-pix/models/webhook_with_secret.rb +220 -0
  168. data/lib/payzu-pix/version.rb +15 -0
  169. data/lib/payzu-pix.rb +119 -0
  170. data/payzu-pix.gemspec +41 -0
  171. data/spec/spec_helper.rb +111 -0
  172. metadata +283 -0
@@ -0,0 +1,583 @@
1
+ =begin
2
+ #PayZu Pix API
3
+
4
+ #REST API for Pix operations on the PayZu platform, deposits, withdrawals, internal transfers, infractions, reports, and callback inspection. All amounts are in BRL (reais) unless explicitly noted. Authentication uses a Bearer token issued during onboarding. ## SDKs oficiais - Node.js: `npm install payzu-pix` - Python: `pip install payzu-pix` - PHP: `composer require payzu/pix` - Ruby: `gem install payzu-pix` - Java: `br.com.payzu:payzu-pix` (Maven Central) - Go: `go get github.com/PayZuAI/payzu-sdks/go/v2` Repo: https://github.com/PayZuAI/payzu-sdks
5
+
6
+ The version of the OpenAPI document: 1.8.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PayZuPix
17
+ class TransactionWithRefunds < ApiModelBase
18
+ # Identifier of the transaction at PayZu.
19
+ attr_accessor :id
20
+
21
+ # PENDING, COMPLETED, CANCELED, WAITING_FOR_REFUND, REFUNDED, EXPIRED, ERROR
22
+ attr_accessor :status
23
+
24
+ # Amount of the transaction, before the fee.
25
+ attr_accessor :amount
26
+
27
+ # Transaction type: DEPOSIT, WITHDRAW, COMMISSION, LIQUIDATION or ADJUSTMENT.
28
+ attr_accessor :type
29
+
30
+ # Copy-and-paste Pix code.
31
+ attr_accessor :qr_code_text
32
+
33
+ # PNG image of the QR Code in base64, without the data: prefix.
34
+ attr_accessor :qr_code_base64
35
+
36
+ # Authenticated route that returns the PNG of the QR Code.
37
+ attr_accessor :qr_code_url
38
+
39
+ # Name used to build the charge.
40
+ attr_accessor :generated_name
41
+
42
+ # CPF or CNPJ used as the debtor of the charge.
43
+ attr_accessor :generated_document
44
+
45
+ # Email used to build the charge.
46
+ attr_accessor :generated_email
47
+
48
+ # Name of the holder of the account that sent the Pix, as reported by the originating institution.
49
+ attr_accessor :payer_name
50
+
51
+ # CPF or CNPJ of the payer of the Pix, reported by the originating institution.
52
+ attr_accessor :payer_document
53
+
54
+ # ISPB code of the institution the Pix was sent from.
55
+ attr_accessor :payer_institution_ispb
56
+
57
+ # Name of the institution the Pix was sent from.
58
+ attr_accessor :payer_institution_name
59
+
60
+ # Payer's PayZu account number (6 digits). Present on withdraw, internal-transfer and commission transactions.
61
+ attr_accessor :payer_account_number
62
+
63
+ # PayZu fee charged on the operation, in reais. It may carry more than two decimal places — do not round when reconciling.
64
+ attr_accessor :service_fee_charged
65
+
66
+ # Destination Pix key of the withdrawal, already normalized.
67
+ attr_accessor :withdraw_pix_key
68
+
69
+ # Type of the destination key of the withdrawal, with evp being the random key.
70
+ attr_accessor :withdraw_pix_type
71
+
72
+ # Name of the holder of the receiving account.
73
+ attr_accessor :receiver_name
74
+
75
+ # CPF or CNPJ of the receiver.
76
+ attr_accessor :receiver_document
77
+
78
+ # ISPB code of the institution that receives the Pix.
79
+ attr_accessor :receiver_institution_ispb
80
+
81
+ # Name of the institution that receives the Pix.
82
+ attr_accessor :receiver_institution_name
83
+
84
+ # Receiver's PayZu account number (6 digits). Present on deposit, internal-transfer and commission transactions.
85
+ attr_accessor :receiver_account_number
86
+
87
+ # Identifier of the Pix in the Bacen arrangement, used to track the settlement and request a return.
88
+ attr_accessor :end_to_end_id
89
+
90
+ # Date and time the transaction was recorded.
91
+ attr_accessor :created_at
92
+
93
+ # Date and time of the last change.
94
+ attr_accessor :updated_at
95
+
96
+ # Date and time the Pix was settled, reported by the institution.
97
+ attr_accessor :paid_at
98
+
99
+ # Your identifier of the transaction, returned in queries and callbacks.
100
+ attr_accessor :client_reference
101
+
102
+ # End-to-end ID of the refund transaction
103
+ attr_accessor :refund_end_to_end_id
104
+
105
+ # Amount refunded
106
+ attr_accessor :refund_amount
107
+
108
+ # Refund status: PENDING, COMPLETED or CANCELED.
109
+ attr_accessor :refund_status
110
+
111
+ # Reason for the refund
112
+ attr_accessor :refund_reason
113
+
114
+ # Description of the refund
115
+ attr_accessor :refund_description
116
+
117
+ # Date and time when the refund was processed
118
+ attr_accessor :refunded_at
119
+
120
+ # Reason for cancellation (if cancelled)
121
+ attr_accessor :cancellation_reason
122
+
123
+ # Virtual sub-account provided at creation.
124
+ attr_accessor :virtual_account
125
+
126
+ # Transaction method/rail.
127
+ attr_accessor :method
128
+
129
+ # Refunds of the transaction, newest first.
130
+ attr_accessor :refunds
131
+
132
+ class EnumAttributeValidator
133
+ attr_reader :datatype
134
+ attr_reader :allowable_values
135
+
136
+ def initialize(datatype, allowable_values)
137
+ @allowable_values = allowable_values.map do |value|
138
+ case datatype.to_s
139
+ when /Integer/i
140
+ value.to_i
141
+ when /Float/i
142
+ value.to_f
143
+ else
144
+ value
145
+ end
146
+ end
147
+ end
148
+
149
+ def valid?(value)
150
+ !value || allowable_values.include?(value)
151
+ end
152
+ end
153
+
154
+ # Attribute mapping from ruby-style variable name to JSON key.
155
+ def self.attribute_map
156
+ {
157
+ :'id' => :'id',
158
+ :'status' => :'status',
159
+ :'amount' => :'amount',
160
+ :'type' => :'type',
161
+ :'qr_code_text' => :'qrCodeText',
162
+ :'qr_code_base64' => :'qrCodeBase64',
163
+ :'qr_code_url' => :'qrCodeUrl',
164
+ :'generated_name' => :'generatedName',
165
+ :'generated_document' => :'generatedDocument',
166
+ :'generated_email' => :'generatedEmail',
167
+ :'payer_name' => :'payerName',
168
+ :'payer_document' => :'payerDocument',
169
+ :'payer_institution_ispb' => :'payerInstitutionIspb',
170
+ :'payer_institution_name' => :'payerInstitutionName',
171
+ :'payer_account_number' => :'payerAccountNumber',
172
+ :'service_fee_charged' => :'serviceFeeCharged',
173
+ :'withdraw_pix_key' => :'withdrawPixKey',
174
+ :'withdraw_pix_type' => :'withdrawPixType',
175
+ :'receiver_name' => :'receiverName',
176
+ :'receiver_document' => :'receiverDocument',
177
+ :'receiver_institution_ispb' => :'receiverInstitutionIspb',
178
+ :'receiver_institution_name' => :'receiverInstitutionName',
179
+ :'receiver_account_number' => :'receiverAccountNumber',
180
+ :'end_to_end_id' => :'endToEndId',
181
+ :'created_at' => :'createdAt',
182
+ :'updated_at' => :'updatedAt',
183
+ :'paid_at' => :'paidAt',
184
+ :'client_reference' => :'clientReference',
185
+ :'refund_end_to_end_id' => :'refundEndToEndId',
186
+ :'refund_amount' => :'refundAmount',
187
+ :'refund_status' => :'refundStatus',
188
+ :'refund_reason' => :'refundReason',
189
+ :'refund_description' => :'refundDescription',
190
+ :'refunded_at' => :'refundedAt',
191
+ :'cancellation_reason' => :'cancellationReason',
192
+ :'virtual_account' => :'virtualAccount',
193
+ :'method' => :'method',
194
+ :'refunds' => :'refunds'
195
+ }
196
+ end
197
+
198
+ # Returns attribute mapping this model knows about
199
+ def self.acceptable_attribute_map
200
+ attribute_map
201
+ end
202
+
203
+ # Returns all the JSON keys this model knows about
204
+ def self.acceptable_attributes
205
+ acceptable_attribute_map.values
206
+ end
207
+
208
+ # Attribute type mapping.
209
+ def self.openapi_types
210
+ {
211
+ :'id' => :'String',
212
+ :'status' => :'String',
213
+ :'amount' => :'Float',
214
+ :'type' => :'String',
215
+ :'qr_code_text' => :'String',
216
+ :'qr_code_base64' => :'String',
217
+ :'qr_code_url' => :'String',
218
+ :'generated_name' => :'String',
219
+ :'generated_document' => :'String',
220
+ :'generated_email' => :'String',
221
+ :'payer_name' => :'String',
222
+ :'payer_document' => :'String',
223
+ :'payer_institution_ispb' => :'String',
224
+ :'payer_institution_name' => :'String',
225
+ :'payer_account_number' => :'String',
226
+ :'service_fee_charged' => :'Float',
227
+ :'withdraw_pix_key' => :'String',
228
+ :'withdraw_pix_type' => :'String',
229
+ :'receiver_name' => :'String',
230
+ :'receiver_document' => :'String',
231
+ :'receiver_institution_ispb' => :'String',
232
+ :'receiver_institution_name' => :'String',
233
+ :'receiver_account_number' => :'String',
234
+ :'end_to_end_id' => :'String',
235
+ :'created_at' => :'String',
236
+ :'updated_at' => :'String',
237
+ :'paid_at' => :'String',
238
+ :'client_reference' => :'String',
239
+ :'refund_end_to_end_id' => :'String',
240
+ :'refund_amount' => :'Float',
241
+ :'refund_status' => :'String',
242
+ :'refund_reason' => :'String',
243
+ :'refund_description' => :'String',
244
+ :'refunded_at' => :'String',
245
+ :'cancellation_reason' => :'String',
246
+ :'virtual_account' => :'String',
247
+ :'method' => :'String',
248
+ :'refunds' => :'Array<Refund>'
249
+ }
250
+ end
251
+
252
+ # List of attributes with nullable: true
253
+ def self.openapi_nullable
254
+ Set.new([
255
+ :'withdraw_pix_type',
256
+ :'refund_status',
257
+ :'refund_reason',
258
+ ])
259
+ end
260
+
261
+ # List of class defined in allOf (OpenAPI v3)
262
+ def self.openapi_all_of
263
+ [
264
+ :'Transaction'
265
+ ]
266
+ end
267
+
268
+ # Initializes the object
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ def initialize(attributes = {})
271
+ if (!attributes.is_a?(Hash))
272
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::TransactionWithRefunds` initialize method"
273
+ end
274
+
275
+ # check to see if the attribute exists and convert string to symbol for hash key
276
+ acceptable_attribute_map = self.class.acceptable_attribute_map
277
+ attributes = attributes.each_with_object({}) { |(k, v), h|
278
+ if (!acceptable_attribute_map.key?(k.to_sym))
279
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::TransactionWithRefunds`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
280
+ end
281
+ h[k.to_sym] = v
282
+ }
283
+
284
+ if attributes.key?(:'id')
285
+ self.id = attributes[:'id']
286
+ end
287
+
288
+ if attributes.key?(:'status')
289
+ self.status = attributes[:'status']
290
+ end
291
+
292
+ if attributes.key?(:'amount')
293
+ self.amount = attributes[:'amount']
294
+ end
295
+
296
+ if attributes.key?(:'type')
297
+ self.type = attributes[:'type']
298
+ end
299
+
300
+ if attributes.key?(:'qr_code_text')
301
+ self.qr_code_text = attributes[:'qr_code_text']
302
+ end
303
+
304
+ if attributes.key?(:'qr_code_base64')
305
+ self.qr_code_base64 = attributes[:'qr_code_base64']
306
+ end
307
+
308
+ if attributes.key?(:'qr_code_url')
309
+ self.qr_code_url = attributes[:'qr_code_url']
310
+ end
311
+
312
+ if attributes.key?(:'generated_name')
313
+ self.generated_name = attributes[:'generated_name']
314
+ end
315
+
316
+ if attributes.key?(:'generated_document')
317
+ self.generated_document = attributes[:'generated_document']
318
+ end
319
+
320
+ if attributes.key?(:'generated_email')
321
+ self.generated_email = attributes[:'generated_email']
322
+ end
323
+
324
+ if attributes.key?(:'payer_name')
325
+ self.payer_name = attributes[:'payer_name']
326
+ end
327
+
328
+ if attributes.key?(:'payer_document')
329
+ self.payer_document = attributes[:'payer_document']
330
+ end
331
+
332
+ if attributes.key?(:'payer_institution_ispb')
333
+ self.payer_institution_ispb = attributes[:'payer_institution_ispb']
334
+ end
335
+
336
+ if attributes.key?(:'payer_institution_name')
337
+ self.payer_institution_name = attributes[:'payer_institution_name']
338
+ end
339
+
340
+ if attributes.key?(:'payer_account_number')
341
+ self.payer_account_number = attributes[:'payer_account_number']
342
+ end
343
+
344
+ if attributes.key?(:'service_fee_charged')
345
+ self.service_fee_charged = attributes[:'service_fee_charged']
346
+ end
347
+
348
+ if attributes.key?(:'withdraw_pix_key')
349
+ self.withdraw_pix_key = attributes[:'withdraw_pix_key']
350
+ end
351
+
352
+ if attributes.key?(:'withdraw_pix_type')
353
+ self.withdraw_pix_type = attributes[:'withdraw_pix_type']
354
+ end
355
+
356
+ if attributes.key?(:'receiver_name')
357
+ self.receiver_name = attributes[:'receiver_name']
358
+ end
359
+
360
+ if attributes.key?(:'receiver_document')
361
+ self.receiver_document = attributes[:'receiver_document']
362
+ end
363
+
364
+ if attributes.key?(:'receiver_institution_ispb')
365
+ self.receiver_institution_ispb = attributes[:'receiver_institution_ispb']
366
+ end
367
+
368
+ if attributes.key?(:'receiver_institution_name')
369
+ self.receiver_institution_name = attributes[:'receiver_institution_name']
370
+ end
371
+
372
+ if attributes.key?(:'receiver_account_number')
373
+ self.receiver_account_number = attributes[:'receiver_account_number']
374
+ end
375
+
376
+ if attributes.key?(:'end_to_end_id')
377
+ self.end_to_end_id = attributes[:'end_to_end_id']
378
+ end
379
+
380
+ if attributes.key?(:'created_at')
381
+ self.created_at = attributes[:'created_at']
382
+ end
383
+
384
+ if attributes.key?(:'updated_at')
385
+ self.updated_at = attributes[:'updated_at']
386
+ end
387
+
388
+ if attributes.key?(:'paid_at')
389
+ self.paid_at = attributes[:'paid_at']
390
+ end
391
+
392
+ if attributes.key?(:'client_reference')
393
+ self.client_reference = attributes[:'client_reference']
394
+ end
395
+
396
+ if attributes.key?(:'refund_end_to_end_id')
397
+ self.refund_end_to_end_id = attributes[:'refund_end_to_end_id']
398
+ end
399
+
400
+ if attributes.key?(:'refund_amount')
401
+ self.refund_amount = attributes[:'refund_amount']
402
+ end
403
+
404
+ if attributes.key?(:'refund_status')
405
+ self.refund_status = attributes[:'refund_status']
406
+ end
407
+
408
+ if attributes.key?(:'refund_reason')
409
+ self.refund_reason = attributes[:'refund_reason']
410
+ end
411
+
412
+ if attributes.key?(:'refund_description')
413
+ self.refund_description = attributes[:'refund_description']
414
+ end
415
+
416
+ if attributes.key?(:'refunded_at')
417
+ self.refunded_at = attributes[:'refunded_at']
418
+ end
419
+
420
+ if attributes.key?(:'cancellation_reason')
421
+ self.cancellation_reason = attributes[:'cancellation_reason']
422
+ end
423
+
424
+ if attributes.key?(:'virtual_account')
425
+ self.virtual_account = attributes[:'virtual_account']
426
+ end
427
+
428
+ if attributes.key?(:'method')
429
+ self.method = attributes[:'method']
430
+ end
431
+
432
+ if attributes.key?(:'refunds')
433
+ if (value = attributes[:'refunds']).is_a?(Array)
434
+ self.refunds = value
435
+ end
436
+ end
437
+ end
438
+
439
+ # Show invalid properties with the reasons. Usually used together with valid?
440
+ # @return Array for valid properties with the reasons
441
+ def list_invalid_properties
442
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
443
+ invalid_properties = Array.new
444
+ if !@virtual_account.nil? && @virtual_account.to_s.length > 50
445
+ invalid_properties.push('invalid value for "virtual_account", the character length must be smaller than or equal to 50.')
446
+ end
447
+
448
+ invalid_properties
449
+ end
450
+
451
+ # Check to see if the all the properties in the model are valid
452
+ # @return true if the model is valid
453
+ def valid?
454
+ warn '[DEPRECATED] the `valid?` method is obsolete'
455
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "COMPLETED", "CANCELED", "WAITING_FOR_REFUND", "REFUNDED", "EXPIRED", "ERROR"])
456
+ return false unless status_validator.valid?(@status)
457
+ type_validator = EnumAttributeValidator.new('String', ["DEPOSIT", "WITHDRAW", "COMMISSION", "LIQUIDATION", "ADJUSTMENT"])
458
+ return false unless type_validator.valid?(@type)
459
+ withdraw_pix_type_validator = EnumAttributeValidator.new('String', ["cpf", "cnpj", "email", "phone", "evp"])
460
+ return false unless withdraw_pix_type_validator.valid?(@withdraw_pix_type)
461
+ refund_status_validator = EnumAttributeValidator.new('String', ["PENDING", "COMPLETED", "CANCELED"])
462
+ return false unless refund_status_validator.valid?(@refund_status)
463
+ refund_reason_validator = EnumAttributeValidator.new('String', ["CUSTOMER_REQUEST", "INFRACTION"])
464
+ return false unless refund_reason_validator.valid?(@refund_reason)
465
+ return false if !@virtual_account.nil? && @virtual_account.to_s.length > 50
466
+ method_validator = EnumAttributeValidator.new('String', ["PIX", "INTERNAL_TRANSFER"])
467
+ return false unless method_validator.valid?(@method)
468
+ true
469
+ end
470
+
471
+ # Custom attribute writer method with validation
472
+ # @param [Object] virtual_account Value to be assigned
473
+ def virtual_account=(virtual_account)
474
+ if virtual_account.nil?
475
+ fail ArgumentError, 'virtual_account cannot be nil'
476
+ end
477
+
478
+ if virtual_account.to_s.length > 50
479
+ fail ArgumentError, 'invalid value for "virtual_account", the character length must be smaller than or equal to 50.'
480
+ end
481
+
482
+ @virtual_account = virtual_account
483
+ end
484
+
485
+ # Checks equality by comparing each attribute.
486
+ # @param [Object] Object to be compared
487
+ def ==(o)
488
+ return true if self.equal?(o)
489
+ self.class == o.class &&
490
+ id == o.id &&
491
+ status == o.status &&
492
+ amount == o.amount &&
493
+ type == o.type &&
494
+ qr_code_text == o.qr_code_text &&
495
+ qr_code_base64 == o.qr_code_base64 &&
496
+ qr_code_url == o.qr_code_url &&
497
+ generated_name == o.generated_name &&
498
+ generated_document == o.generated_document &&
499
+ generated_email == o.generated_email &&
500
+ payer_name == o.payer_name &&
501
+ payer_document == o.payer_document &&
502
+ payer_institution_ispb == o.payer_institution_ispb &&
503
+ payer_institution_name == o.payer_institution_name &&
504
+ payer_account_number == o.payer_account_number &&
505
+ service_fee_charged == o.service_fee_charged &&
506
+ withdraw_pix_key == o.withdraw_pix_key &&
507
+ withdraw_pix_type == o.withdraw_pix_type &&
508
+ receiver_name == o.receiver_name &&
509
+ receiver_document == o.receiver_document &&
510
+ receiver_institution_ispb == o.receiver_institution_ispb &&
511
+ receiver_institution_name == o.receiver_institution_name &&
512
+ receiver_account_number == o.receiver_account_number &&
513
+ end_to_end_id == o.end_to_end_id &&
514
+ created_at == o.created_at &&
515
+ updated_at == o.updated_at &&
516
+ paid_at == o.paid_at &&
517
+ client_reference == o.client_reference &&
518
+ refund_end_to_end_id == o.refund_end_to_end_id &&
519
+ refund_amount == o.refund_amount &&
520
+ refund_status == o.refund_status &&
521
+ refund_reason == o.refund_reason &&
522
+ refund_description == o.refund_description &&
523
+ refunded_at == o.refunded_at &&
524
+ cancellation_reason == o.cancellation_reason &&
525
+ virtual_account == o.virtual_account &&
526
+ method == o.method &&
527
+ refunds == o.refunds
528
+ end
529
+
530
+ # @see the `==` method
531
+ # @param [Object] Object to be compared
532
+ def eql?(o)
533
+ self == o
534
+ end
535
+
536
+ # Calculates hash code according to all attributes.
537
+ # @return [Integer] Hash code
538
+ def hash
539
+ [id, status, amount, type, qr_code_text, qr_code_base64, qr_code_url, generated_name, generated_document, generated_email, payer_name, payer_document, payer_institution_ispb, payer_institution_name, payer_account_number, service_fee_charged, withdraw_pix_key, withdraw_pix_type, receiver_name, receiver_document, receiver_institution_ispb, receiver_institution_name, receiver_account_number, end_to_end_id, created_at, updated_at, paid_at, client_reference, refund_end_to_end_id, refund_amount, refund_status, refund_reason, refund_description, refunded_at, cancellation_reason, virtual_account, method, refunds].hash
540
+ end
541
+
542
+ # Builds the object from hash
543
+ # @param [Hash] attributes Model attributes in the form of hash
544
+ # @return [Object] Returns the model itself
545
+ def self.build_from_hash(attributes)
546
+ return nil unless attributes.is_a?(Hash)
547
+ attributes = attributes.transform_keys(&:to_sym)
548
+ transformed_hash = {}
549
+ openapi_types.each_pair do |key, type|
550
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
551
+ transformed_hash["#{key}"] = nil
552
+ elsif type =~ /\AArray<(.*)>/i
553
+ # check to ensure the input is an array given that the attribute
554
+ # is documented as an array but the input is not
555
+ if attributes[attribute_map[key]].is_a?(Array)
556
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
557
+ end
558
+ elsif !attributes[attribute_map[key]].nil?
559
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
560
+ end
561
+ end
562
+ new(transformed_hash)
563
+ end
564
+
565
+ # Returns the object in the form of hash
566
+ # @return [Hash] Returns the object in the form of hash
567
+ def to_hash
568
+ hash = {}
569
+ self.class.attribute_map.each_pair do |attr, param|
570
+ value = self.send(attr)
571
+ if value.nil?
572
+ is_nullable = self.class.openapi_nullable.include?(attr)
573
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
574
+ end
575
+
576
+ hash[param] = _to_hash(value)
577
+ end
578
+ hash
579
+ end
580
+
581
+ end
582
+
583
+ end