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,299 @@
|
|
|
1
|
+
# PayZuPix::WithdrawalsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.payzu.processamento.com/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**get_withdraw**](WithdrawalsApi.md#get_withdraw) | **GET** /withdraw | Retrieve Withdrawal |
|
|
8
|
+
| [**get_withdraw_proof**](WithdrawalsApi.md#get_withdraw_proof) | **GET** /withdraw/proof/{id} | Get Withdrawal Receipt |
|
|
9
|
+
| [**post_withdraw**](WithdrawalsApi.md#post_withdraw) | **POST** /withdraw | Create Withdrawal (Pix key) |
|
|
10
|
+
| [**post_withdraw_qrcode**](WithdrawalsApi.md#post_withdraw_qrcode) | **POST** /withdraw/qrcode | Create Withdrawal using QR Code |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## get_withdraw
|
|
14
|
+
|
|
15
|
+
> <Transaction> get_withdraw(opts)
|
|
16
|
+
|
|
17
|
+
Retrieve Withdrawal
|
|
18
|
+
|
|
19
|
+
Get the latest status and details of a transaction of the account. Provide at least one of `id`, `clientReference`, or `endToEndId`. If more than one is provided, all are applied as filters (AND), which may return no record if they do not point to the same transaction. Token permission: `WITHDRAW`.
|
|
20
|
+
|
|
21
|
+
### Examples
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
require 'time'
|
|
25
|
+
require 'payzu-pix'
|
|
26
|
+
# setup authorization
|
|
27
|
+
PayZuPix.configure do |config|
|
|
28
|
+
# Configure Bearer authorization: BearerAuth
|
|
29
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
api_instance = PayZuPix::WithdrawalsApi.new
|
|
33
|
+
opts = {
|
|
34
|
+
id: 'PAYZU20260817B3PL8SG5WQ000000', # String | Transaction ID.
|
|
35
|
+
client_reference: 'order_12345', # String | External reference provided when creating the withdrawal.
|
|
36
|
+
end_to_end_id: 'E00000000202508172159kZ8dQ2mNb1x', # String | Pix end-to-end ID.
|
|
37
|
+
virtual_account: 'loja-centro-01' # String | Virtual sub-account (up to 50 characters) used at creation. Accepted as an alternative lookup key.
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
begin
|
|
41
|
+
# Retrieve Withdrawal
|
|
42
|
+
result = api_instance.get_withdraw(opts)
|
|
43
|
+
p result
|
|
44
|
+
rescue PayZuPix::ApiError => e
|
|
45
|
+
puts "Error when calling WithdrawalsApi->get_withdraw: #{e}"
|
|
46
|
+
end
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Using the get_withdraw_with_http_info variant
|
|
50
|
+
|
|
51
|
+
This returns an Array which contains the response data, status code and headers.
|
|
52
|
+
|
|
53
|
+
> <Array(<Transaction>, Integer, Hash)> get_withdraw_with_http_info(opts)
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
begin
|
|
57
|
+
# Retrieve Withdrawal
|
|
58
|
+
data, status_code, headers = api_instance.get_withdraw_with_http_info(opts)
|
|
59
|
+
p status_code # => 2xx
|
|
60
|
+
p headers # => { ... }
|
|
61
|
+
p data # => <Transaction>
|
|
62
|
+
rescue PayZuPix::ApiError => e
|
|
63
|
+
puts "Error when calling WithdrawalsApi->get_withdraw_with_http_info: #{e}"
|
|
64
|
+
end
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Parameters
|
|
68
|
+
|
|
69
|
+
| Name | Type | Description | Notes |
|
|
70
|
+
| ---- | ---- | ----------- | ----- |
|
|
71
|
+
| **id** | **String** | Transaction ID. | [optional] |
|
|
72
|
+
| **client_reference** | **String** | External reference provided when creating the withdrawal. | [optional] |
|
|
73
|
+
| **end_to_end_id** | **String** | Pix end-to-end ID. | [optional] |
|
|
74
|
+
| **virtual_account** | **String** | Virtual sub-account (up to 50 characters) used at creation. Accepted as an alternative lookup key. | [optional] |
|
|
75
|
+
|
|
76
|
+
### Return type
|
|
77
|
+
|
|
78
|
+
[**Transaction**](Transaction.md)
|
|
79
|
+
|
|
80
|
+
### Authorization
|
|
81
|
+
|
|
82
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
83
|
+
|
|
84
|
+
### HTTP request headers
|
|
85
|
+
|
|
86
|
+
- **Content-Type**: Not defined
|
|
87
|
+
- **Accept**: application/json
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## get_withdraw_proof
|
|
91
|
+
|
|
92
|
+
> <ProofResponse> get_withdraw_proof(id, opts)
|
|
93
|
+
|
|
94
|
+
Get Withdrawal Receipt
|
|
95
|
+
|
|
96
|
+
Returns the transaction receipt. By default (`type=pdf`) the response is the PDF file; with `type=base64` it is JSON with the `base64` field, the PDF as a data URI.
|
|
97
|
+
|
|
98
|
+
### Examples
|
|
99
|
+
|
|
100
|
+
```ruby
|
|
101
|
+
require 'time'
|
|
102
|
+
require 'payzu-pix'
|
|
103
|
+
# setup authorization
|
|
104
|
+
PayZuPix.configure do |config|
|
|
105
|
+
# Configure Bearer authorization: BearerAuth
|
|
106
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
api_instance = PayZuPix::WithdrawalsApi.new
|
|
110
|
+
id = 'PAYZU20260817B3PL8SG5WQ000000' # String | Transaction ID.
|
|
111
|
+
opts = {
|
|
112
|
+
type: 'pdf' # String | Return format.
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
begin
|
|
116
|
+
# Get Withdrawal Receipt
|
|
117
|
+
result = api_instance.get_withdraw_proof(id, opts)
|
|
118
|
+
p result
|
|
119
|
+
rescue PayZuPix::ApiError => e
|
|
120
|
+
puts "Error when calling WithdrawalsApi->get_withdraw_proof: #{e}"
|
|
121
|
+
end
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Using the get_withdraw_proof_with_http_info variant
|
|
125
|
+
|
|
126
|
+
This returns an Array which contains the response data, status code and headers.
|
|
127
|
+
|
|
128
|
+
> <Array(<ProofResponse>, Integer, Hash)> get_withdraw_proof_with_http_info(id, opts)
|
|
129
|
+
|
|
130
|
+
```ruby
|
|
131
|
+
begin
|
|
132
|
+
# Get Withdrawal Receipt
|
|
133
|
+
data, status_code, headers = api_instance.get_withdraw_proof_with_http_info(id, opts)
|
|
134
|
+
p status_code # => 2xx
|
|
135
|
+
p headers # => { ... }
|
|
136
|
+
p data # => <ProofResponse>
|
|
137
|
+
rescue PayZuPix::ApiError => e
|
|
138
|
+
puts "Error when calling WithdrawalsApi->get_withdraw_proof_with_http_info: #{e}"
|
|
139
|
+
end
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Parameters
|
|
143
|
+
|
|
144
|
+
| Name | Type | Description | Notes |
|
|
145
|
+
| ---- | ---- | ----------- | ----- |
|
|
146
|
+
| **id** | **String** | Transaction ID. | |
|
|
147
|
+
| **type** | **String** | Return format. | [optional][default to 'pdf'] |
|
|
148
|
+
|
|
149
|
+
### Return type
|
|
150
|
+
|
|
151
|
+
[**ProofResponse**](ProofResponse.md)
|
|
152
|
+
|
|
153
|
+
### Authorization
|
|
154
|
+
|
|
155
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
156
|
+
|
|
157
|
+
### HTTP request headers
|
|
158
|
+
|
|
159
|
+
- **Content-Type**: Not defined
|
|
160
|
+
- **Accept**: application/json, application/pdf
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## post_withdraw
|
|
164
|
+
|
|
165
|
+
> <Transaction> post_withdraw(post_withdraw_request)
|
|
166
|
+
|
|
167
|
+
Create Withdrawal (Pix key)
|
|
168
|
+
|
|
169
|
+
Send a Pix **cash out** to the specified Pix key. Token permission: `WITHDRAW`.
|
|
170
|
+
|
|
171
|
+
### Examples
|
|
172
|
+
|
|
173
|
+
```ruby
|
|
174
|
+
require 'time'
|
|
175
|
+
require 'payzu-pix'
|
|
176
|
+
# setup authorization
|
|
177
|
+
PayZuPix.configure do |config|
|
|
178
|
+
# Configure Bearer authorization: BearerAuth
|
|
179
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
api_instance = PayZuPix::WithdrawalsApi.new
|
|
183
|
+
post_withdraw_request = PayZuPix::PostWithdrawRequest.new({amount: 2, pix_key: 'teste@teste.com', pix_type: 'cpf'}) # PostWithdrawRequest |
|
|
184
|
+
|
|
185
|
+
begin
|
|
186
|
+
# Create Withdrawal (Pix key)
|
|
187
|
+
result = api_instance.post_withdraw(post_withdraw_request)
|
|
188
|
+
p result
|
|
189
|
+
rescue PayZuPix::ApiError => e
|
|
190
|
+
puts "Error when calling WithdrawalsApi->post_withdraw: #{e}"
|
|
191
|
+
end
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### Using the post_withdraw_with_http_info variant
|
|
195
|
+
|
|
196
|
+
This returns an Array which contains the response data, status code and headers.
|
|
197
|
+
|
|
198
|
+
> <Array(<Transaction>, Integer, Hash)> post_withdraw_with_http_info(post_withdraw_request)
|
|
199
|
+
|
|
200
|
+
```ruby
|
|
201
|
+
begin
|
|
202
|
+
# Create Withdrawal (Pix key)
|
|
203
|
+
data, status_code, headers = api_instance.post_withdraw_with_http_info(post_withdraw_request)
|
|
204
|
+
p status_code # => 2xx
|
|
205
|
+
p headers # => { ... }
|
|
206
|
+
p data # => <Transaction>
|
|
207
|
+
rescue PayZuPix::ApiError => e
|
|
208
|
+
puts "Error when calling WithdrawalsApi->post_withdraw_with_http_info: #{e}"
|
|
209
|
+
end
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Parameters
|
|
213
|
+
|
|
214
|
+
| Name | Type | Description | Notes |
|
|
215
|
+
| ---- | ---- | ----------- | ----- |
|
|
216
|
+
| **post_withdraw_request** | [**PostWithdrawRequest**](PostWithdrawRequest.md) | | |
|
|
217
|
+
|
|
218
|
+
### Return type
|
|
219
|
+
|
|
220
|
+
[**Transaction**](Transaction.md)
|
|
221
|
+
|
|
222
|
+
### Authorization
|
|
223
|
+
|
|
224
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
225
|
+
|
|
226
|
+
### HTTP request headers
|
|
227
|
+
|
|
228
|
+
- **Content-Type**: application/json
|
|
229
|
+
- **Accept**: application/json
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
## post_withdraw_qrcode
|
|
233
|
+
|
|
234
|
+
> <Transaction> post_withdraw_qrcode(post_withdraw_qrcode_request)
|
|
235
|
+
|
|
236
|
+
Create Withdrawal using QR Code
|
|
237
|
+
|
|
238
|
+
Cash out using a **Pix QR Code** (static/dynamic). If `amount` is not provided, the QR Code's embedded value will be used. PayZu processes both dynamic and static QR Codes. Token permission: `WITHDRAW`.
|
|
239
|
+
|
|
240
|
+
### Examples
|
|
241
|
+
|
|
242
|
+
```ruby
|
|
243
|
+
require 'time'
|
|
244
|
+
require 'payzu-pix'
|
|
245
|
+
# setup authorization
|
|
246
|
+
PayZuPix.configure do |config|
|
|
247
|
+
# Configure Bearer authorization: BearerAuth
|
|
248
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
api_instance = PayZuPix::WithdrawalsApi.new
|
|
252
|
+
post_withdraw_qrcode_request = PayZuPix::PostWithdrawQrcodeRequest.new({qr_code: '00020101021226770014br.gov.bcb.pix2555api.payzu/pix/qr/v2/013318d6-2d7d-479e-8bb3-b5c7b9da688c5204000053039865802BR5916PAYZU 6007SAOPAULO6217051320260118278956304EC55'}) # PostWithdrawQrcodeRequest |
|
|
253
|
+
|
|
254
|
+
begin
|
|
255
|
+
# Create Withdrawal using QR Code
|
|
256
|
+
result = api_instance.post_withdraw_qrcode(post_withdraw_qrcode_request)
|
|
257
|
+
p result
|
|
258
|
+
rescue PayZuPix::ApiError => e
|
|
259
|
+
puts "Error when calling WithdrawalsApi->post_withdraw_qrcode: #{e}"
|
|
260
|
+
end
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### Using the post_withdraw_qrcode_with_http_info variant
|
|
264
|
+
|
|
265
|
+
This returns an Array which contains the response data, status code and headers.
|
|
266
|
+
|
|
267
|
+
> <Array(<Transaction>, Integer, Hash)> post_withdraw_qrcode_with_http_info(post_withdraw_qrcode_request)
|
|
268
|
+
|
|
269
|
+
```ruby
|
|
270
|
+
begin
|
|
271
|
+
# Create Withdrawal using QR Code
|
|
272
|
+
data, status_code, headers = api_instance.post_withdraw_qrcode_with_http_info(post_withdraw_qrcode_request)
|
|
273
|
+
p status_code # => 2xx
|
|
274
|
+
p headers # => { ... }
|
|
275
|
+
p data # => <Transaction>
|
|
276
|
+
rescue PayZuPix::ApiError => e
|
|
277
|
+
puts "Error when calling WithdrawalsApi->post_withdraw_qrcode_with_http_info: #{e}"
|
|
278
|
+
end
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Parameters
|
|
282
|
+
|
|
283
|
+
| Name | Type | Description | Notes |
|
|
284
|
+
| ---- | ---- | ----------- | ----- |
|
|
285
|
+
| **post_withdraw_qrcode_request** | [**PostWithdrawQrcodeRequest**](PostWithdrawQrcodeRequest.md) | | |
|
|
286
|
+
|
|
287
|
+
### Return type
|
|
288
|
+
|
|
289
|
+
[**Transaction**](Transaction.md)
|
|
290
|
+
|
|
291
|
+
### Authorization
|
|
292
|
+
|
|
293
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
294
|
+
|
|
295
|
+
### HTTP request headers
|
|
296
|
+
|
|
297
|
+
- **Content-Type**: application/json
|
|
298
|
+
- **Accept**: application/json
|
|
299
|
+
|
data/git_push.sh
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
3
|
+
#
|
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
|
5
|
+
|
|
6
|
+
git_user_id=$1
|
|
7
|
+
git_repo_id=$2
|
|
8
|
+
release_note=$3
|
|
9
|
+
git_host=$4
|
|
10
|
+
|
|
11
|
+
if [ "$git_host" = "" ]; then
|
|
12
|
+
git_host="github.com"
|
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
|
17
|
+
git_user_id="PayZuAI"
|
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
|
22
|
+
git_repo_id="payzu-sdks"
|
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [ "$release_note" = "" ]; then
|
|
27
|
+
release_note="Minor update"
|
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Initialize the local directory as a Git repository
|
|
32
|
+
git init
|
|
33
|
+
|
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
|
35
|
+
git add .
|
|
36
|
+
|
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
38
|
+
git commit -m "$release_note"
|
|
39
|
+
|
|
40
|
+
# Sets the new remote
|
|
41
|
+
git_remote=$(git remote)
|
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
|
43
|
+
|
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
|
47
|
+
else
|
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
git pull origin master
|
|
54
|
+
|
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
|
@@ -0,0 +1,136 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module PayZuPix
|
|
16
|
+
class AccountApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Account Info
|
|
23
|
+
# Account profile, permissions, limits and fee rules.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [GetUser200Response]
|
|
26
|
+
def get_user(opts = {})
|
|
27
|
+
data, _status_code, _headers = get_user_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Account Info
|
|
32
|
+
# Account profile, permissions, limits and fee rules.
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(GetUser200Response, Integer, Hash)>] GetUser200Response data, response status code and response headers
|
|
35
|
+
def get_user_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.get_user ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/user'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
|
|
50
|
+
# form parameters
|
|
51
|
+
form_params = opts[:form_params] || {}
|
|
52
|
+
|
|
53
|
+
# http body (model)
|
|
54
|
+
post_body = opts[:debug_body]
|
|
55
|
+
|
|
56
|
+
# return_type
|
|
57
|
+
return_type = opts[:debug_return_type] || 'GetUser200Response'
|
|
58
|
+
|
|
59
|
+
# auth_names
|
|
60
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
61
|
+
|
|
62
|
+
new_options = opts.merge(
|
|
63
|
+
:operation => :"AccountApi.get_user",
|
|
64
|
+
:header_params => header_params,
|
|
65
|
+
:query_params => query_params,
|
|
66
|
+
:form_params => form_params,
|
|
67
|
+
:body => post_body,
|
|
68
|
+
:auth_names => auth_names,
|
|
69
|
+
:return_type => return_type
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
73
|
+
if @api_client.config.debugging
|
|
74
|
+
@api_client.config.logger.debug "API called: AccountApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
|
+
end
|
|
76
|
+
return data, status_code, headers
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Account Balance
|
|
80
|
+
# Available and blocked balances.
|
|
81
|
+
# @param [Hash] opts the optional parameters
|
|
82
|
+
# @return [GetUserBalance200Response]
|
|
83
|
+
def get_user_balance(opts = {})
|
|
84
|
+
data, _status_code, _headers = get_user_balance_with_http_info(opts)
|
|
85
|
+
data
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Account Balance
|
|
89
|
+
# Available and blocked balances.
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [Array<(GetUserBalance200Response, Integer, Hash)>] GetUserBalance200Response data, response status code and response headers
|
|
92
|
+
def get_user_balance_with_http_info(opts = {})
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.get_user_balance ...'
|
|
95
|
+
end
|
|
96
|
+
# resource path
|
|
97
|
+
local_var_path = '/user/balance'
|
|
98
|
+
|
|
99
|
+
# query parameters
|
|
100
|
+
query_params = opts[:query_params] || {}
|
|
101
|
+
|
|
102
|
+
# header parameters
|
|
103
|
+
header_params = opts[:header_params] || {}
|
|
104
|
+
# HTTP header 'Accept' (if needed)
|
|
105
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
106
|
+
|
|
107
|
+
# form parameters
|
|
108
|
+
form_params = opts[:form_params] || {}
|
|
109
|
+
|
|
110
|
+
# http body (model)
|
|
111
|
+
post_body = opts[:debug_body]
|
|
112
|
+
|
|
113
|
+
# return_type
|
|
114
|
+
return_type = opts[:debug_return_type] || 'GetUserBalance200Response'
|
|
115
|
+
|
|
116
|
+
# auth_names
|
|
117
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
118
|
+
|
|
119
|
+
new_options = opts.merge(
|
|
120
|
+
:operation => :"AccountApi.get_user_balance",
|
|
121
|
+
:header_params => header_params,
|
|
122
|
+
:query_params => query_params,
|
|
123
|
+
:form_params => form_params,
|
|
124
|
+
:body => post_body,
|
|
125
|
+
:auth_names => auth_names,
|
|
126
|
+
:return_type => return_type
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
130
|
+
if @api_client.config.debugging
|
|
131
|
+
@api_client.config.logger.debug "API called: AccountApi#get_user_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
132
|
+
end
|
|
133
|
+
return data, status_code, headers
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|