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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +231 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +141 -0
- data/docs/ApiErrorDetailsInner.md +20 -0
- data/docs/BankStatement.md +42 -0
- data/docs/BankStatementListResponse.md +20 -0
- data/docs/BankStatementListResponsePagination.md +22 -0
- data/docs/CallbackDetail.md +34 -0
- data/docs/CallbackListResponse.md +20 -0
- data/docs/CallbackListResponsePagination.md +22 -0
- data/docs/CallbackSecretResponse.md +20 -0
- data/docs/CallbacksApi.md +587 -0
- data/docs/Defense.md +30 -0
- data/docs/DefenseFilesInner.md +24 -0
- data/docs/DefenseHistoryEntry.md +28 -0
- data/docs/DefenseHistoryEntryFilesInner.md +22 -0
- data/docs/DepositPending.md +62 -0
- data/docs/DepositPendingListResponse.md +24 -0
- data/docs/DictConsultResponse.md +30 -0
- data/docs/DownloadUserReport200Response.md +20 -0
- data/docs/EnqueuedCallback.md +18 -0
- data/docs/EnqueuedCallbackEnqueued.md +22 -0
- data/docs/EnqueuedCallbackItem.md +22 -0
- data/docs/ErrorResponse.md +32 -0
- data/docs/GetUser200Response.md +46 -0
- data/docs/GetUser200ResponseDailyWithdrawLimit.md +24 -0
- data/docs/GetUser200ResponseServiceFee.md +28 -0
- data/docs/GetUserBalance200Response.md +20 -0
- data/docs/GetUserTransactionById200Response.md +94 -0
- data/docs/GetUserTransactionById200ResponseAllOfCallbackLogInner.md +26 -0
- data/docs/GetUserTransactionById200ResponseAllOfInfractionInner.md +24 -0
- data/docs/GetUserTransactions200Response.md +22 -0
- data/docs/InfractionDetail.md +40 -0
- data/docs/InfractionDetailTransaction.md +30 -0
- data/docs/InfractionListResponse.md +20 -0
- data/docs/InfractionListResponsePagination.md +24 -0
- data/docs/InfractionsApi.md +413 -0
- data/docs/InternalTransferApi.md +153 -0
- data/docs/KeysAndDICTApi.md +217 -0
- data/docs/ListUserReports200Response.md +22 -0
- data/docs/PixKeyInfo.md +36 -0
- data/docs/PixOperationsApi.md +299 -0
- data/docs/PostInternalTransferRequest.md +30 -0
- data/docs/PostPixQrcodeReadRequest.md +18 -0
- data/docs/PostPixRequest.md +32 -0
- data/docs/PostUserReportRequest.md +24 -0
- data/docs/PostWithdrawQrcodeRequest.md +28 -0
- data/docs/PostWithdrawRequest.md +30 -0
- data/docs/ProofResponse.md +18 -0
- data/docs/QRCodeReadResponse.md +38 -0
- data/docs/Refund.md +34 -0
- data/docs/RefundRequest.md +22 -0
- data/docs/RefundsApi.md +79 -0
- data/docs/ReportJob.md +30 -0
- data/docs/ReportJobAccepted.md +30 -0
- data/docs/ReportJobDetail.md +30 -0
- data/docs/ReportsApi.md +881 -0
- data/docs/ResendUserCallbackSingle200Response.md +18 -0
- data/docs/ResendUserCallbacks200Response.md +20 -0
- data/docs/ResendUserCallbacksRequest.md +28 -0
- data/docs/ResendWebhookCallbacksRequest.md +30 -0
- data/docs/RotateCallbackSecretResponse.md +18 -0
- data/docs/RotateSecretResponse.md +18 -0
- data/docs/SentWebhookDetail.md +40 -0
- data/docs/SentWebhookDetailResponse.md +18 -0
- data/docs/SentWebhooksQuantity.md +18 -0
- data/docs/Summary.md +26 -0
- data/docs/SummaryBlock.md +24 -0
- data/docs/SummaryBlockGroupedInner.md +20 -0
- data/docs/SummaryBlockStatuses.md +26 -0
- data/docs/SummaryStatus.md +22 -0
- data/docs/Transaction.md +90 -0
- data/docs/TransactionWithRefunds.md +92 -0
- data/docs/Webhook.md +30 -0
- data/docs/WebhookCreateRequest.md +24 -0
- data/docs/WebhookEventType.md +15 -0
- data/docs/WebhookListResponse.md +18 -0
- data/docs/WebhookUpdateRequest.md +22 -0
- data/docs/WebhookWithSecret.md +32 -0
- data/docs/WebhooksApi.md +574 -0
- data/docs/WithdrawalsApi.md +299 -0
- data/git_push.sh +57 -0
- data/lib/payzu-pix/api/account_api.rb +136 -0
- data/lib/payzu-pix/api/callbacks_api.rb +577 -0
- data/lib/payzu-pix/api/infractions_api.rb +452 -0
- data/lib/payzu-pix/api/internal_transfer_api.rb +164 -0
- data/lib/payzu-pix/api/keys_and_dict_api.rb +234 -0
- data/lib/payzu-pix/api/pix_operations_api.rb +300 -0
- data/lib/payzu-pix/api/refunds_api.rb +96 -0
- data/lib/payzu-pix/api/reports_api.rb +968 -0
- data/lib/payzu-pix/api/webhooks_api.rb +542 -0
- data/lib/payzu-pix/api/withdrawals_api.rb +305 -0
- data/lib/payzu-pix/api_client.rb +441 -0
- data/lib/payzu-pix/api_error.rb +58 -0
- data/lib/payzu-pix/api_model_base.rb +88 -0
- data/lib/payzu-pix/configuration.rb +392 -0
- data/lib/payzu-pix/models/api_error_details_inner.rb +192 -0
- data/lib/payzu-pix/models/bank_statement.rb +296 -0
- data/lib/payzu-pix/models/bank_statement_list_response.rb +159 -0
- data/lib/payzu-pix/models/bank_statement_list_response_pagination.rb +169 -0
- data/lib/payzu-pix/models/callback_detail.rb +228 -0
- data/lib/payzu-pix/models/callback_list_response.rb +159 -0
- data/lib/payzu-pix/models/callback_list_response_pagination.rb +169 -0
- data/lib/payzu-pix/models/callback_secret_response.rb +158 -0
- data/lib/payzu-pix/models/defense.rb +234 -0
- data/lib/payzu-pix/models/defense_files_inner.rb +179 -0
- data/lib/payzu-pix/models/defense_history_entry.rb +225 -0
- data/lib/payzu-pix/models/defense_history_entry_files_inner.rb +168 -0
- data/lib/payzu-pix/models/deposit_pending.rb +407 -0
- data/lib/payzu-pix/models/deposit_pending_list_response.rb +180 -0
- data/lib/payzu-pix/models/dict_consult_response.rb +231 -0
- data/lib/payzu-pix/models/download_user_report200_response.rb +158 -0
- data/lib/payzu-pix/models/enqueued_callback.rb +147 -0
- data/lib/payzu-pix/models/enqueued_callback_enqueued.rb +170 -0
- data/lib/payzu-pix/models/enqueued_callback_item.rb +190 -0
- data/lib/payzu-pix/models/error_response.rb +336 -0
- data/lib/payzu-pix/models/get_user200_response.rb +334 -0
- data/lib/payzu-pix/models/get_user200_response_daily_withdraw_limit.rb +180 -0
- data/lib/payzu-pix/models/get_user200_response_service_fee.rb +199 -0
- data/lib/payzu-pix/models/get_user_balance200_response.rb +158 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response.rb +595 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_callback_log_inner.rb +188 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_infraction_inner.rb +202 -0
- data/lib/payzu-pix/models/get_user_transactions200_response.rb +170 -0
- data/lib/payzu-pix/models/infraction_detail.rb +293 -0
- data/lib/payzu-pix/models/infraction_detail_transaction.rb +213 -0
- data/lib/payzu-pix/models/infraction_list_response.rb +159 -0
- data/lib/payzu-pix/models/infraction_list_response_pagination.rb +179 -0
- data/lib/payzu-pix/models/list_user_reports200_response.rb +170 -0
- data/lib/payzu-pix/models/pix_key_info.rb +263 -0
- data/lib/payzu-pix/models/post_internal_transfer_request.rb +377 -0
- data/lib/payzu-pix/models/post_pix_qrcode_read_request.rb +174 -0
- data/lib/payzu-pix/models/post_pix_request.rb +382 -0
- data/lib/payzu-pix/models/post_user_report_request.rb +238 -0
- data/lib/payzu-pix/models/post_withdraw_qrcode_request.rb +302 -0
- data/lib/payzu-pix/models/post_withdraw_request.rb +350 -0
- data/lib/payzu-pix/models/proof_response.rb +148 -0
- data/lib/payzu-pix/models/qr_code_read_response.rb +283 -0
- data/lib/payzu-pix/models/refund.rb +257 -0
- data/lib/payzu-pix/models/refund_request.rb +215 -0
- data/lib/payzu-pix/models/report_job.rb +234 -0
- data/lib/payzu-pix/models/report_job_accepted.rb +237 -0
- data/lib/payzu-pix/models/report_job_detail.rb +237 -0
- data/lib/payzu-pix/models/resend_user_callback_single200_response.rb +148 -0
- data/lib/payzu-pix/models/resend_user_callbacks200_response.rb +158 -0
- data/lib/payzu-pix/models/resend_user_callbacks_request.rb +262 -0
- data/lib/payzu-pix/models/resend_webhook_callbacks_request.rb +274 -0
- data/lib/payzu-pix/models/rotate_callback_secret_response.rb +148 -0
- data/lib/payzu-pix/models/rotate_secret_response.rb +148 -0
- data/lib/payzu-pix/models/sent_webhook_detail.rb +261 -0
- data/lib/payzu-pix/models/sent_webhook_detail_response.rb +164 -0
- data/lib/payzu-pix/models/sent_webhooks_quantity.rb +148 -0
- data/lib/payzu-pix/models/summary.rb +188 -0
- data/lib/payzu-pix/models/summary_block.rb +179 -0
- data/lib/payzu-pix/models/summary_block_grouped_inner.rb +158 -0
- data/lib/payzu-pix/models/summary_block_statuses.rb +189 -0
- data/lib/payzu-pix/models/summary_status.rb +168 -0
- data/lib/payzu-pix/models/transaction.rb +588 -0
- data/lib/payzu-pix/models/transaction_with_refunds.rb +583 -0
- data/lib/payzu-pix/models/webhook.rb +210 -0
- data/lib/payzu-pix/models/webhook_create_request.rb +201 -0
- data/lib/payzu-pix/models/webhook_event_type.rb +47 -0
- data/lib/payzu-pix/models/webhook_list_response.rb +150 -0
- data/lib/payzu-pix/models/webhook_update_request.rb +171 -0
- data/lib/payzu-pix/models/webhook_with_secret.rb +220 -0
- data/lib/payzu-pix/version.rb +15 -0
- data/lib/payzu-pix.rb +119 -0
- data/payzu-pix.gemspec +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +283 -0
|
@@ -0,0 +1,377 @@
|
|
|
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 PostInternalTransferRequest < ApiModelBase
|
|
18
|
+
# Payer account number (6 digits). Must match the authenticated user's accountNumber.
|
|
19
|
+
attr_accessor :payer_account_number
|
|
20
|
+
|
|
21
|
+
# Destination account number (6 digits).
|
|
22
|
+
attr_accessor :receiver_account_number
|
|
23
|
+
|
|
24
|
+
# Transfer amount in BRL, with at most 2 decimal places.
|
|
25
|
+
attr_accessor :amount
|
|
26
|
+
|
|
27
|
+
# Optional transfer description.
|
|
28
|
+
attr_accessor :description
|
|
29
|
+
|
|
30
|
+
# URL for transaction notifications (http or https).
|
|
31
|
+
attr_accessor :callback_url
|
|
32
|
+
|
|
33
|
+
# External reference for idempotency / reconciliation.
|
|
34
|
+
attr_accessor :client_reference
|
|
35
|
+
|
|
36
|
+
# Virtual sub-account (up to 50 characters) to correlate stores, branches, marketplaces. Returned in the callback.
|
|
37
|
+
attr_accessor :virtual_account
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'payer_account_number' => :'payerAccountNumber',
|
|
43
|
+
:'receiver_account_number' => :'receiverAccountNumber',
|
|
44
|
+
:'amount' => :'amount',
|
|
45
|
+
:'description' => :'description',
|
|
46
|
+
:'callback_url' => :'callbackUrl',
|
|
47
|
+
:'client_reference' => :'clientReference',
|
|
48
|
+
:'virtual_account' => :'virtualAccount'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'payer_account_number' => :'String',
|
|
66
|
+
:'receiver_account_number' => :'String',
|
|
67
|
+
:'amount' => :'Float',
|
|
68
|
+
:'description' => :'String',
|
|
69
|
+
:'callback_url' => :'String',
|
|
70
|
+
:'client_reference' => :'String',
|
|
71
|
+
:'virtual_account' => :'String'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# List of attributes with nullable: true
|
|
76
|
+
def self.openapi_nullable
|
|
77
|
+
Set.new([
|
|
78
|
+
])
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Initializes the object
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
def initialize(attributes = {})
|
|
84
|
+
if (!attributes.is_a?(Hash))
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::PostInternalTransferRequest` initialize method"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::PostInternalTransferRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
|
+
h[k.to_sym] = v
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'payer_account_number')
|
|
98
|
+
self.payer_account_number = attributes[:'payer_account_number']
|
|
99
|
+
else
|
|
100
|
+
self.payer_account_number = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'receiver_account_number')
|
|
104
|
+
self.receiver_account_number = attributes[:'receiver_account_number']
|
|
105
|
+
else
|
|
106
|
+
self.receiver_account_number = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'amount')
|
|
110
|
+
self.amount = attributes[:'amount']
|
|
111
|
+
else
|
|
112
|
+
self.amount = nil
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'description')
|
|
116
|
+
self.description = attributes[:'description']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'callback_url')
|
|
120
|
+
self.callback_url = attributes[:'callback_url']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'client_reference')
|
|
124
|
+
self.client_reference = attributes[:'client_reference']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'virtual_account')
|
|
128
|
+
self.virtual_account = attributes[:'virtual_account']
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
133
|
+
# @return Array for valid properties with the reasons
|
|
134
|
+
def list_invalid_properties
|
|
135
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
136
|
+
invalid_properties = Array.new
|
|
137
|
+
if @payer_account_number.nil?
|
|
138
|
+
invalid_properties.push('invalid value for "payer_account_number", payer_account_number cannot be nil.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
pattern = Regexp.new(/^\d{6}$/)
|
|
142
|
+
if @payer_account_number !~ pattern
|
|
143
|
+
invalid_properties.push("invalid value for \"payer_account_number\", must conform to the pattern #{pattern}.")
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @receiver_account_number.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "receiver_account_number", receiver_account_number cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
pattern = Regexp.new(/^\d{6}$/)
|
|
151
|
+
if @receiver_account_number !~ pattern
|
|
152
|
+
invalid_properties.push("invalid value for \"receiver_account_number\", must conform to the pattern #{pattern}.")
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @amount.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @amount < 0.01
|
|
160
|
+
invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.01.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if !@description.nil? && @description.to_s.length > 500
|
|
164
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
pattern = Regexp.new(/^https?:\/\//)
|
|
168
|
+
if !@callback_url.nil? && @callback_url !~ pattern
|
|
169
|
+
invalid_properties.push("invalid value for \"callback_url\", must conform to the pattern #{pattern}.")
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if !@client_reference.nil? && @client_reference.to_s.length > 64
|
|
173
|
+
invalid_properties.push('invalid value for "client_reference", the character length must be smaller than or equal to 64.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if !@virtual_account.nil? && @virtual_account.to_s.length > 50
|
|
177
|
+
invalid_properties.push('invalid value for "virtual_account", the character length must be smaller than or equal to 50.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if !@virtual_account.nil? && @virtual_account.to_s.length < 1
|
|
181
|
+
invalid_properties.push('invalid value for "virtual_account", the character length must be greater than or equal to 1.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
invalid_properties
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Check to see if the all the properties in the model are valid
|
|
188
|
+
# @return true if the model is valid
|
|
189
|
+
def valid?
|
|
190
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
191
|
+
return false if @payer_account_number.nil?
|
|
192
|
+
return false if @payer_account_number !~ Regexp.new(/^\d{6}$/)
|
|
193
|
+
return false if @receiver_account_number.nil?
|
|
194
|
+
return false if @receiver_account_number !~ Regexp.new(/^\d{6}$/)
|
|
195
|
+
return false if @amount.nil?
|
|
196
|
+
return false if @amount < 0.01
|
|
197
|
+
return false if !@description.nil? && @description.to_s.length > 500
|
|
198
|
+
return false if !@callback_url.nil? && @callback_url !~ Regexp.new(/^https?:\/\//)
|
|
199
|
+
return false if !@client_reference.nil? && @client_reference.to_s.length > 64
|
|
200
|
+
return false if !@virtual_account.nil? && @virtual_account.to_s.length > 50
|
|
201
|
+
return false if !@virtual_account.nil? && @virtual_account.to_s.length < 1
|
|
202
|
+
true
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Custom attribute writer method with validation
|
|
206
|
+
# @param [Object] payer_account_number Value to be assigned
|
|
207
|
+
def payer_account_number=(payer_account_number)
|
|
208
|
+
if payer_account_number.nil?
|
|
209
|
+
fail ArgumentError, 'payer_account_number cannot be nil'
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
pattern = Regexp.new(/^\d{6}$/)
|
|
213
|
+
if payer_account_number !~ pattern
|
|
214
|
+
fail ArgumentError, "invalid value for \"payer_account_number\", must conform to the pattern #{pattern}."
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@payer_account_number = payer_account_number
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method with validation
|
|
221
|
+
# @param [Object] receiver_account_number Value to be assigned
|
|
222
|
+
def receiver_account_number=(receiver_account_number)
|
|
223
|
+
if receiver_account_number.nil?
|
|
224
|
+
fail ArgumentError, 'receiver_account_number cannot be nil'
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
pattern = Regexp.new(/^\d{6}$/)
|
|
228
|
+
if receiver_account_number !~ pattern
|
|
229
|
+
fail ArgumentError, "invalid value for \"receiver_account_number\", must conform to the pattern #{pattern}."
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@receiver_account_number = receiver_account_number
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] amount Value to be assigned
|
|
237
|
+
def amount=(amount)
|
|
238
|
+
if amount.nil?
|
|
239
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if amount < 0.01
|
|
243
|
+
fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.01.'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
@amount = amount
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Custom attribute writer method with validation
|
|
250
|
+
# @param [Object] description Value to be assigned
|
|
251
|
+
def description=(description)
|
|
252
|
+
if description.nil?
|
|
253
|
+
fail ArgumentError, 'description cannot be nil'
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if description.to_s.length > 500
|
|
257
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
@description = description
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Custom attribute writer method with validation
|
|
264
|
+
# @param [Object] callback_url Value to be assigned
|
|
265
|
+
def callback_url=(callback_url)
|
|
266
|
+
if callback_url.nil?
|
|
267
|
+
fail ArgumentError, 'callback_url cannot be nil'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
pattern = Regexp.new(/^https?:\/\//)
|
|
271
|
+
if callback_url !~ pattern
|
|
272
|
+
fail ArgumentError, "invalid value for \"callback_url\", must conform to the pattern #{pattern}."
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
@callback_url = callback_url
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Custom attribute writer method with validation
|
|
279
|
+
# @param [Object] client_reference Value to be assigned
|
|
280
|
+
def client_reference=(client_reference)
|
|
281
|
+
if client_reference.nil?
|
|
282
|
+
fail ArgumentError, 'client_reference cannot be nil'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if client_reference.to_s.length > 64
|
|
286
|
+
fail ArgumentError, 'invalid value for "client_reference", the character length must be smaller than or equal to 64.'
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
@client_reference = client_reference
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Custom attribute writer method with validation
|
|
293
|
+
# @param [Object] virtual_account Value to be assigned
|
|
294
|
+
def virtual_account=(virtual_account)
|
|
295
|
+
if virtual_account.nil?
|
|
296
|
+
fail ArgumentError, 'virtual_account cannot be nil'
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
if virtual_account.to_s.length > 50
|
|
300
|
+
fail ArgumentError, 'invalid value for "virtual_account", the character length must be smaller than or equal to 50.'
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
if virtual_account.to_s.length < 1
|
|
304
|
+
fail ArgumentError, 'invalid value for "virtual_account", the character length must be greater than or equal to 1.'
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
@virtual_account = virtual_account
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Checks equality by comparing each attribute.
|
|
311
|
+
# @param [Object] Object to be compared
|
|
312
|
+
def ==(o)
|
|
313
|
+
return true if self.equal?(o)
|
|
314
|
+
self.class == o.class &&
|
|
315
|
+
payer_account_number == o.payer_account_number &&
|
|
316
|
+
receiver_account_number == o.receiver_account_number &&
|
|
317
|
+
amount == o.amount &&
|
|
318
|
+
description == o.description &&
|
|
319
|
+
callback_url == o.callback_url &&
|
|
320
|
+
client_reference == o.client_reference &&
|
|
321
|
+
virtual_account == o.virtual_account
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# @see the `==` method
|
|
325
|
+
# @param [Object] Object to be compared
|
|
326
|
+
def eql?(o)
|
|
327
|
+
self == o
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
# Calculates hash code according to all attributes.
|
|
331
|
+
# @return [Integer] Hash code
|
|
332
|
+
def hash
|
|
333
|
+
[payer_account_number, receiver_account_number, amount, description, callback_url, client_reference, virtual_account].hash
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Builds the object from hash
|
|
337
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
338
|
+
# @return [Object] Returns the model itself
|
|
339
|
+
def self.build_from_hash(attributes)
|
|
340
|
+
return nil unless attributes.is_a?(Hash)
|
|
341
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
342
|
+
transformed_hash = {}
|
|
343
|
+
openapi_types.each_pair do |key, type|
|
|
344
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
345
|
+
transformed_hash["#{key}"] = nil
|
|
346
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
347
|
+
# check to ensure the input is an array given that the attribute
|
|
348
|
+
# is documented as an array but the input is not
|
|
349
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
350
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
351
|
+
end
|
|
352
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
353
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
new(transformed_hash)
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# Returns the object in the form of hash
|
|
360
|
+
# @return [Hash] Returns the object in the form of hash
|
|
361
|
+
def to_hash
|
|
362
|
+
hash = {}
|
|
363
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
364
|
+
value = self.send(attr)
|
|
365
|
+
if value.nil?
|
|
366
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
367
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
hash[param] = _to_hash(value)
|
|
371
|
+
end
|
|
372
|
+
hash
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
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 PostPixQrcodeReadRequest < ApiModelBase
|
|
18
|
+
# The EMV payload string from the Pix QR Code.
|
|
19
|
+
attr_accessor :emv
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'emv' => :'emv'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'emv' => :'String'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::PostPixQrcodeReadRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::PostPixQrcodeReadRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'emv')
|
|
68
|
+
self.emv = attributes[:'emv']
|
|
69
|
+
else
|
|
70
|
+
self.emv = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @emv.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "emv", emv cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if @emv.to_s.length < 1
|
|
84
|
+
invalid_properties.push('invalid value for "emv", the character length must be greater than or equal to 1.')
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
return false if @emv.nil?
|
|
95
|
+
return false if @emv.to_s.length < 1
|
|
96
|
+
true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Custom attribute writer method with validation
|
|
100
|
+
# @param [Object] emv Value to be assigned
|
|
101
|
+
def emv=(emv)
|
|
102
|
+
if emv.nil?
|
|
103
|
+
fail ArgumentError, 'emv cannot be nil'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if emv.to_s.length < 1
|
|
107
|
+
fail ArgumentError, 'invalid value for "emv", the character length must be greater than or equal to 1.'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@emv = emv
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
emv == o.emv
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# @see the `==` method
|
|
122
|
+
# @param [Object] Object to be compared
|
|
123
|
+
def eql?(o)
|
|
124
|
+
self == o
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Calculates hash code according to all attributes.
|
|
128
|
+
# @return [Integer] Hash code
|
|
129
|
+
def hash
|
|
130
|
+
[emv].hash
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Builds the object from hash
|
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
135
|
+
# @return [Object] Returns the model itself
|
|
136
|
+
def self.build_from_hash(attributes)
|
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
|
138
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
139
|
+
transformed_hash = {}
|
|
140
|
+
openapi_types.each_pair do |key, type|
|
|
141
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = nil
|
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
144
|
+
# check to ensure the input is an array given that the attribute
|
|
145
|
+
# is documented as an array but the input is not
|
|
146
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
147
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
148
|
+
end
|
|
149
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
150
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
new(transformed_hash)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Returns the object in the form of hash
|
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
|
158
|
+
def to_hash
|
|
159
|
+
hash = {}
|
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
161
|
+
value = self.send(attr)
|
|
162
|
+
if value.nil?
|
|
163
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
164
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
hash[param] = _to_hash(value)
|
|
168
|
+
end
|
|
169
|
+
hash
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
end
|