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,588 @@
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
+ # Unified transaction representation used by all endpoints.
18
+ class Transaction < ApiModelBase
19
+ # Identifier of the transaction at PayZu.
20
+ attr_accessor :id
21
+
22
+ # PENDING, COMPLETED, CANCELED, WAITING_FOR_REFUND, REFUNDED, EXPIRED, ERROR
23
+ attr_accessor :status
24
+
25
+ # Amount of the transaction, before the fee.
26
+ attr_accessor :amount
27
+
28
+ # Transaction type: DEPOSIT, WITHDRAW, COMMISSION, LIQUIDATION or ADJUSTMENT.
29
+ attr_accessor :type
30
+
31
+ # Copy-and-paste Pix code.
32
+ attr_accessor :qr_code_text
33
+
34
+ # PNG image of the QR Code in base64, without the data: prefix.
35
+ attr_accessor :qr_code_base64
36
+
37
+ # Authenticated route that returns the PNG of the QR Code.
38
+ attr_accessor :qr_code_url
39
+
40
+ # Name used to build the charge.
41
+ attr_accessor :generated_name
42
+
43
+ # CPF or CNPJ used as the debtor of the charge.
44
+ attr_accessor :generated_document
45
+
46
+ # Email used to build the charge.
47
+ attr_accessor :generated_email
48
+
49
+ # Name of the holder of the account that sent the Pix, as reported by the originating institution.
50
+ attr_accessor :payer_name
51
+
52
+ # CPF or CNPJ of the payer of the Pix, reported by the originating institution.
53
+ attr_accessor :payer_document
54
+
55
+ # ISPB code of the institution the Pix was sent from.
56
+ attr_accessor :payer_institution_ispb
57
+
58
+ # Name of the institution the Pix was sent from.
59
+ attr_accessor :payer_institution_name
60
+
61
+ # Payer's PayZu account number (6 digits). Present on withdraw, internal-transfer and commission transactions.
62
+ attr_accessor :payer_account_number
63
+
64
+ # PayZu fee charged on the operation, in reais. It may carry more than two decimal places — do not round when reconciling.
65
+ attr_accessor :service_fee_charged
66
+
67
+ # Destination Pix key of the withdrawal, already normalized.
68
+ attr_accessor :withdraw_pix_key
69
+
70
+ # Type of the destination key of the withdrawal, with evp being the random key.
71
+ attr_accessor :withdraw_pix_type
72
+
73
+ # Name of the holder of the receiving account.
74
+ attr_accessor :receiver_name
75
+
76
+ # CPF or CNPJ of the receiver.
77
+ attr_accessor :receiver_document
78
+
79
+ # ISPB code of the institution that receives the Pix.
80
+ attr_accessor :receiver_institution_ispb
81
+
82
+ # Name of the institution that receives the Pix.
83
+ attr_accessor :receiver_institution_name
84
+
85
+ # Receiver's PayZu account number (6 digits). Present on deposit, internal-transfer and commission transactions.
86
+ attr_accessor :receiver_account_number
87
+
88
+ # Identifier of the Pix in the Bacen arrangement, used to track the settlement and request a return.
89
+ attr_accessor :end_to_end_id
90
+
91
+ # Date and time the transaction was recorded.
92
+ attr_accessor :created_at
93
+
94
+ # Date and time of the last change.
95
+ attr_accessor :updated_at
96
+
97
+ # Date and time the Pix was settled, reported by the institution.
98
+ attr_accessor :paid_at
99
+
100
+ # Your identifier of the transaction, returned in queries and callbacks.
101
+ attr_accessor :client_reference
102
+
103
+ # End-to-end ID of the refund transaction
104
+ attr_accessor :refund_end_to_end_id
105
+
106
+ # Amount refunded
107
+ attr_accessor :refund_amount
108
+
109
+ # Refund status: PENDING, COMPLETED or CANCELED.
110
+ attr_accessor :refund_status
111
+
112
+ # Reason for the refund
113
+ attr_accessor :refund_reason
114
+
115
+ # Description of the refund
116
+ attr_accessor :refund_description
117
+
118
+ # Date and time when the refund was processed
119
+ attr_accessor :refunded_at
120
+
121
+ # Reason for cancellation (if cancelled)
122
+ attr_accessor :cancellation_reason
123
+
124
+ # Virtual sub-account provided at creation.
125
+ attr_accessor :virtual_account
126
+
127
+ # Transaction method/rail.
128
+ attr_accessor :method
129
+
130
+ class EnumAttributeValidator
131
+ attr_reader :datatype
132
+ attr_reader :allowable_values
133
+
134
+ def initialize(datatype, allowable_values)
135
+ @allowable_values = allowable_values.map do |value|
136
+ case datatype.to_s
137
+ when /Integer/i
138
+ value.to_i
139
+ when /Float/i
140
+ value.to_f
141
+ else
142
+ value
143
+ end
144
+ end
145
+ end
146
+
147
+ def valid?(value)
148
+ !value || allowable_values.include?(value)
149
+ end
150
+ end
151
+
152
+ # Attribute mapping from ruby-style variable name to JSON key.
153
+ def self.attribute_map
154
+ {
155
+ :'id' => :'id',
156
+ :'status' => :'status',
157
+ :'amount' => :'amount',
158
+ :'type' => :'type',
159
+ :'qr_code_text' => :'qrCodeText',
160
+ :'qr_code_base64' => :'qrCodeBase64',
161
+ :'qr_code_url' => :'qrCodeUrl',
162
+ :'generated_name' => :'generatedName',
163
+ :'generated_document' => :'generatedDocument',
164
+ :'generated_email' => :'generatedEmail',
165
+ :'payer_name' => :'payerName',
166
+ :'payer_document' => :'payerDocument',
167
+ :'payer_institution_ispb' => :'payerInstitutionIspb',
168
+ :'payer_institution_name' => :'payerInstitutionName',
169
+ :'payer_account_number' => :'payerAccountNumber',
170
+ :'service_fee_charged' => :'serviceFeeCharged',
171
+ :'withdraw_pix_key' => :'withdrawPixKey',
172
+ :'withdraw_pix_type' => :'withdrawPixType',
173
+ :'receiver_name' => :'receiverName',
174
+ :'receiver_document' => :'receiverDocument',
175
+ :'receiver_institution_ispb' => :'receiverInstitutionIspb',
176
+ :'receiver_institution_name' => :'receiverInstitutionName',
177
+ :'receiver_account_number' => :'receiverAccountNumber',
178
+ :'end_to_end_id' => :'endToEndId',
179
+ :'created_at' => :'createdAt',
180
+ :'updated_at' => :'updatedAt',
181
+ :'paid_at' => :'paidAt',
182
+ :'client_reference' => :'clientReference',
183
+ :'refund_end_to_end_id' => :'refundEndToEndId',
184
+ :'refund_amount' => :'refundAmount',
185
+ :'refund_status' => :'refundStatus',
186
+ :'refund_reason' => :'refundReason',
187
+ :'refund_description' => :'refundDescription',
188
+ :'refunded_at' => :'refundedAt',
189
+ :'cancellation_reason' => :'cancellationReason',
190
+ :'virtual_account' => :'virtualAccount',
191
+ :'method' => :'method'
192
+ }
193
+ end
194
+
195
+ # Returns attribute mapping this model knows about
196
+ def self.acceptable_attribute_map
197
+ attribute_map
198
+ end
199
+
200
+ # Returns all the JSON keys this model knows about
201
+ def self.acceptable_attributes
202
+ acceptable_attribute_map.values
203
+ end
204
+
205
+ # Attribute type mapping.
206
+ def self.openapi_types
207
+ {
208
+ :'id' => :'String',
209
+ :'status' => :'String',
210
+ :'amount' => :'Float',
211
+ :'type' => :'String',
212
+ :'qr_code_text' => :'String',
213
+ :'qr_code_base64' => :'String',
214
+ :'qr_code_url' => :'String',
215
+ :'generated_name' => :'String',
216
+ :'generated_document' => :'String',
217
+ :'generated_email' => :'String',
218
+ :'payer_name' => :'String',
219
+ :'payer_document' => :'String',
220
+ :'payer_institution_ispb' => :'String',
221
+ :'payer_institution_name' => :'String',
222
+ :'payer_account_number' => :'String',
223
+ :'service_fee_charged' => :'Float',
224
+ :'withdraw_pix_key' => :'String',
225
+ :'withdraw_pix_type' => :'String',
226
+ :'receiver_name' => :'String',
227
+ :'receiver_document' => :'String',
228
+ :'receiver_institution_ispb' => :'String',
229
+ :'receiver_institution_name' => :'String',
230
+ :'receiver_account_number' => :'String',
231
+ :'end_to_end_id' => :'String',
232
+ :'created_at' => :'String',
233
+ :'updated_at' => :'String',
234
+ :'paid_at' => :'String',
235
+ :'client_reference' => :'String',
236
+ :'refund_end_to_end_id' => :'String',
237
+ :'refund_amount' => :'Float',
238
+ :'refund_status' => :'String',
239
+ :'refund_reason' => :'String',
240
+ :'refund_description' => :'String',
241
+ :'refunded_at' => :'String',
242
+ :'cancellation_reason' => :'String',
243
+ :'virtual_account' => :'String',
244
+ :'method' => :'String'
245
+ }
246
+ end
247
+
248
+ # List of attributes with nullable: true
249
+ def self.openapi_nullable
250
+ Set.new([
251
+ :'qr_code_text',
252
+ :'qr_code_base64',
253
+ :'qr_code_url',
254
+ :'generated_name',
255
+ :'generated_document',
256
+ :'generated_email',
257
+ :'payer_name',
258
+ :'payer_document',
259
+ :'payer_institution_ispb',
260
+ :'payer_institution_name',
261
+ :'payer_account_number',
262
+ :'service_fee_charged',
263
+ :'withdraw_pix_key',
264
+ :'withdraw_pix_type',
265
+ :'receiver_name',
266
+ :'receiver_document',
267
+ :'receiver_institution_ispb',
268
+ :'receiver_institution_name',
269
+ :'receiver_account_number',
270
+ :'end_to_end_id',
271
+ :'paid_at',
272
+ :'client_reference',
273
+ :'refund_end_to_end_id',
274
+ :'refund_amount',
275
+ :'refund_status',
276
+ :'refund_reason',
277
+ :'refund_description',
278
+ :'refunded_at',
279
+ :'cancellation_reason',
280
+ :'virtual_account',
281
+ ])
282
+ end
283
+
284
+ # Initializes the object
285
+ # @param [Hash] attributes Model attributes in the form of hash
286
+ def initialize(attributes = {})
287
+ if (!attributes.is_a?(Hash))
288
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::Transaction` initialize method"
289
+ end
290
+
291
+ # check to see if the attribute exists and convert string to symbol for hash key
292
+ acceptable_attribute_map = self.class.acceptable_attribute_map
293
+ attributes = attributes.each_with_object({}) { |(k, v), h|
294
+ if (!acceptable_attribute_map.key?(k.to_sym))
295
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::Transaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
296
+ end
297
+ h[k.to_sym] = v
298
+ }
299
+
300
+ if attributes.key?(:'id')
301
+ self.id = attributes[:'id']
302
+ end
303
+
304
+ if attributes.key?(:'status')
305
+ self.status = attributes[:'status']
306
+ end
307
+
308
+ if attributes.key?(:'amount')
309
+ self.amount = attributes[:'amount']
310
+ end
311
+
312
+ if attributes.key?(:'type')
313
+ self.type = attributes[:'type']
314
+ end
315
+
316
+ if attributes.key?(:'qr_code_text')
317
+ self.qr_code_text = attributes[:'qr_code_text']
318
+ end
319
+
320
+ if attributes.key?(:'qr_code_base64')
321
+ self.qr_code_base64 = attributes[:'qr_code_base64']
322
+ end
323
+
324
+ if attributes.key?(:'qr_code_url')
325
+ self.qr_code_url = attributes[:'qr_code_url']
326
+ end
327
+
328
+ if attributes.key?(:'generated_name')
329
+ self.generated_name = attributes[:'generated_name']
330
+ end
331
+
332
+ if attributes.key?(:'generated_document')
333
+ self.generated_document = attributes[:'generated_document']
334
+ end
335
+
336
+ if attributes.key?(:'generated_email')
337
+ self.generated_email = attributes[:'generated_email']
338
+ end
339
+
340
+ if attributes.key?(:'payer_name')
341
+ self.payer_name = attributes[:'payer_name']
342
+ end
343
+
344
+ if attributes.key?(:'payer_document')
345
+ self.payer_document = attributes[:'payer_document']
346
+ end
347
+
348
+ if attributes.key?(:'payer_institution_ispb')
349
+ self.payer_institution_ispb = attributes[:'payer_institution_ispb']
350
+ end
351
+
352
+ if attributes.key?(:'payer_institution_name')
353
+ self.payer_institution_name = attributes[:'payer_institution_name']
354
+ end
355
+
356
+ if attributes.key?(:'payer_account_number')
357
+ self.payer_account_number = attributes[:'payer_account_number']
358
+ end
359
+
360
+ if attributes.key?(:'service_fee_charged')
361
+ self.service_fee_charged = attributes[:'service_fee_charged']
362
+ end
363
+
364
+ if attributes.key?(:'withdraw_pix_key')
365
+ self.withdraw_pix_key = attributes[:'withdraw_pix_key']
366
+ end
367
+
368
+ if attributes.key?(:'withdraw_pix_type')
369
+ self.withdraw_pix_type = attributes[:'withdraw_pix_type']
370
+ end
371
+
372
+ if attributes.key?(:'receiver_name')
373
+ self.receiver_name = attributes[:'receiver_name']
374
+ end
375
+
376
+ if attributes.key?(:'receiver_document')
377
+ self.receiver_document = attributes[:'receiver_document']
378
+ end
379
+
380
+ if attributes.key?(:'receiver_institution_ispb')
381
+ self.receiver_institution_ispb = attributes[:'receiver_institution_ispb']
382
+ end
383
+
384
+ if attributes.key?(:'receiver_institution_name')
385
+ self.receiver_institution_name = attributes[:'receiver_institution_name']
386
+ end
387
+
388
+ if attributes.key?(:'receiver_account_number')
389
+ self.receiver_account_number = attributes[:'receiver_account_number']
390
+ end
391
+
392
+ if attributes.key?(:'end_to_end_id')
393
+ self.end_to_end_id = attributes[:'end_to_end_id']
394
+ end
395
+
396
+ if attributes.key?(:'created_at')
397
+ self.created_at = attributes[:'created_at']
398
+ end
399
+
400
+ if attributes.key?(:'updated_at')
401
+ self.updated_at = attributes[:'updated_at']
402
+ end
403
+
404
+ if attributes.key?(:'paid_at')
405
+ self.paid_at = attributes[:'paid_at']
406
+ end
407
+
408
+ if attributes.key?(:'client_reference')
409
+ self.client_reference = attributes[:'client_reference']
410
+ end
411
+
412
+ if attributes.key?(:'refund_end_to_end_id')
413
+ self.refund_end_to_end_id = attributes[:'refund_end_to_end_id']
414
+ end
415
+
416
+ if attributes.key?(:'refund_amount')
417
+ self.refund_amount = attributes[:'refund_amount']
418
+ end
419
+
420
+ if attributes.key?(:'refund_status')
421
+ self.refund_status = attributes[:'refund_status']
422
+ end
423
+
424
+ if attributes.key?(:'refund_reason')
425
+ self.refund_reason = attributes[:'refund_reason']
426
+ end
427
+
428
+ if attributes.key?(:'refund_description')
429
+ self.refund_description = attributes[:'refund_description']
430
+ end
431
+
432
+ if attributes.key?(:'refunded_at')
433
+ self.refunded_at = attributes[:'refunded_at']
434
+ end
435
+
436
+ if attributes.key?(:'cancellation_reason')
437
+ self.cancellation_reason = attributes[:'cancellation_reason']
438
+ end
439
+
440
+ if attributes.key?(:'virtual_account')
441
+ self.virtual_account = attributes[:'virtual_account']
442
+ end
443
+
444
+ if attributes.key?(:'method')
445
+ self.method = attributes[:'method']
446
+ end
447
+ end
448
+
449
+ # Show invalid properties with the reasons. Usually used together with valid?
450
+ # @return Array for valid properties with the reasons
451
+ def list_invalid_properties
452
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
453
+ invalid_properties = Array.new
454
+ if !@virtual_account.nil? && @virtual_account.to_s.length > 50
455
+ invalid_properties.push('invalid value for "virtual_account", the character length must be smaller than or equal to 50.')
456
+ end
457
+
458
+ invalid_properties
459
+ end
460
+
461
+ # Check to see if the all the properties in the model are valid
462
+ # @return true if the model is valid
463
+ def valid?
464
+ warn '[DEPRECATED] the `valid?` method is obsolete'
465
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "COMPLETED", "CANCELED", "WAITING_FOR_REFUND", "REFUNDED", "EXPIRED", "ERROR"])
466
+ return false unless status_validator.valid?(@status)
467
+ type_validator = EnumAttributeValidator.new('String', ["DEPOSIT", "WITHDRAW", "COMMISSION", "LIQUIDATION", "ADJUSTMENT"])
468
+ return false unless type_validator.valid?(@type)
469
+ withdraw_pix_type_validator = EnumAttributeValidator.new('String', ["cpf", "cnpj", "email", "phone", "evp"])
470
+ return false unless withdraw_pix_type_validator.valid?(@withdraw_pix_type)
471
+ refund_status_validator = EnumAttributeValidator.new('String', ["PENDING", "COMPLETED", "CANCELED"])
472
+ return false unless refund_status_validator.valid?(@refund_status)
473
+ refund_reason_validator = EnumAttributeValidator.new('String', ["CUSTOMER_REQUEST", "INFRACTION"])
474
+ return false unless refund_reason_validator.valid?(@refund_reason)
475
+ return false if !@virtual_account.nil? && @virtual_account.to_s.length > 50
476
+ method_validator = EnumAttributeValidator.new('String', ["PIX", "INTERNAL_TRANSFER"])
477
+ return false unless method_validator.valid?(@method)
478
+ true
479
+ end
480
+
481
+ # Custom attribute writer method with validation
482
+ # @param [Object] virtual_account Value to be assigned
483
+ def virtual_account=(virtual_account)
484
+ if !virtual_account.nil? && virtual_account.to_s.length > 50
485
+ fail ArgumentError, 'invalid value for "virtual_account", the character length must be smaller than or equal to 50.'
486
+ end
487
+
488
+ @virtual_account = virtual_account
489
+ end
490
+
491
+ # Checks equality by comparing each attribute.
492
+ # @param [Object] Object to be compared
493
+ def ==(o)
494
+ return true if self.equal?(o)
495
+ self.class == o.class &&
496
+ id == o.id &&
497
+ status == o.status &&
498
+ amount == o.amount &&
499
+ type == o.type &&
500
+ qr_code_text == o.qr_code_text &&
501
+ qr_code_base64 == o.qr_code_base64 &&
502
+ qr_code_url == o.qr_code_url &&
503
+ generated_name == o.generated_name &&
504
+ generated_document == o.generated_document &&
505
+ generated_email == o.generated_email &&
506
+ payer_name == o.payer_name &&
507
+ payer_document == o.payer_document &&
508
+ payer_institution_ispb == o.payer_institution_ispb &&
509
+ payer_institution_name == o.payer_institution_name &&
510
+ payer_account_number == o.payer_account_number &&
511
+ service_fee_charged == o.service_fee_charged &&
512
+ withdraw_pix_key == o.withdraw_pix_key &&
513
+ withdraw_pix_type == o.withdraw_pix_type &&
514
+ receiver_name == o.receiver_name &&
515
+ receiver_document == o.receiver_document &&
516
+ receiver_institution_ispb == o.receiver_institution_ispb &&
517
+ receiver_institution_name == o.receiver_institution_name &&
518
+ receiver_account_number == o.receiver_account_number &&
519
+ end_to_end_id == o.end_to_end_id &&
520
+ created_at == o.created_at &&
521
+ updated_at == o.updated_at &&
522
+ paid_at == o.paid_at &&
523
+ client_reference == o.client_reference &&
524
+ refund_end_to_end_id == o.refund_end_to_end_id &&
525
+ refund_amount == o.refund_amount &&
526
+ refund_status == o.refund_status &&
527
+ refund_reason == o.refund_reason &&
528
+ refund_description == o.refund_description &&
529
+ refunded_at == o.refunded_at &&
530
+ cancellation_reason == o.cancellation_reason &&
531
+ virtual_account == o.virtual_account &&
532
+ method == o.method
533
+ end
534
+
535
+ # @see the `==` method
536
+ # @param [Object] Object to be compared
537
+ def eql?(o)
538
+ self == o
539
+ end
540
+
541
+ # Calculates hash code according to all attributes.
542
+ # @return [Integer] Hash code
543
+ def hash
544
+ [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].hash
545
+ end
546
+
547
+ # Builds the object from hash
548
+ # @param [Hash] attributes Model attributes in the form of hash
549
+ # @return [Object] Returns the model itself
550
+ def self.build_from_hash(attributes)
551
+ return nil unless attributes.is_a?(Hash)
552
+ attributes = attributes.transform_keys(&:to_sym)
553
+ transformed_hash = {}
554
+ openapi_types.each_pair do |key, type|
555
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
556
+ transformed_hash["#{key}"] = nil
557
+ elsif type =~ /\AArray<(.*)>/i
558
+ # check to ensure the input is an array given that the attribute
559
+ # is documented as an array but the input is not
560
+ if attributes[attribute_map[key]].is_a?(Array)
561
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
562
+ end
563
+ elsif !attributes[attribute_map[key]].nil?
564
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
565
+ end
566
+ end
567
+ new(transformed_hash)
568
+ end
569
+
570
+ # Returns the object in the form of hash
571
+ # @return [Hash] Returns the object in the form of hash
572
+ def to_hash
573
+ hash = {}
574
+ self.class.attribute_map.each_pair do |attr, param|
575
+ value = self.send(attr)
576
+ if value.nil?
577
+ is_nullable = self.class.openapi_nullable.include?(attr)
578
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
579
+ end
580
+
581
+ hash[param] = _to_hash(value)
582
+ end
583
+ hash
584
+ end
585
+
586
+ end
587
+
588
+ end