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,305 @@
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 WithdrawalsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Retrieve Withdrawal
23
+ # 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`.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :id Transaction ID.
26
+ # @option opts [String] :client_reference External reference provided when creating the withdrawal.
27
+ # @option opts [String] :end_to_end_id Pix end-to-end ID.
28
+ # @option opts [String] :virtual_account Virtual sub-account (up to 50 characters) used at creation. Accepted as an alternative lookup key.
29
+ # @return [Transaction]
30
+ def get_withdraw(opts = {})
31
+ data, _status_code, _headers = get_withdraw_with_http_info(opts)
32
+ data
33
+ end
34
+
35
+ # Retrieve Withdrawal
36
+ # 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`.
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :id Transaction ID.
39
+ # @option opts [String] :client_reference External reference provided when creating the withdrawal.
40
+ # @option opts [String] :end_to_end_id Pix end-to-end ID.
41
+ # @option opts [String] :virtual_account Virtual sub-account (up to 50 characters) used at creation. Accepted as an alternative lookup key.
42
+ # @return [Array<(Transaction, Integer, Hash)>] Transaction data, response status code and response headers
43
+ def get_withdraw_with_http_info(opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: WithdrawalsApi.get_withdraw ...'
46
+ end
47
+ if @api_client.config.client_side_validation && !opts[:'client_reference'].nil? && opts[:'client_reference'].to_s.length > 64
48
+ fail ArgumentError, 'invalid value for "opts[:"client_reference"]" when calling WithdrawalsApi.get_withdraw, the character length must be smaller than or equal to 64.'
49
+ end
50
+
51
+ if @api_client.config.client_side_validation && !opts[:'virtual_account'].nil? && opts[:'virtual_account'].to_s.length > 50
52
+ fail ArgumentError, 'invalid value for "opts[:"virtual_account"]" when calling WithdrawalsApi.get_withdraw, the character length must be smaller than or equal to 50.'
53
+ end
54
+
55
+ # resource path
56
+ local_var_path = '/withdraw'
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
61
+ query_params[:'clientReference'] = opts[:'client_reference'] if !opts[:'client_reference'].nil?
62
+ query_params[:'endToEndId'] = opts[:'end_to_end_id'] if !opts[:'end_to_end_id'].nil?
63
+ query_params[:'virtualAccount'] = opts[:'virtual_account'] if !opts[:'virtual_account'].nil?
64
+
65
+ # header parameters
66
+ header_params = opts[:header_params] || {}
67
+ # HTTP header 'Accept' (if needed)
68
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
69
+
70
+ # form parameters
71
+ form_params = opts[:form_params] || {}
72
+
73
+ # http body (model)
74
+ post_body = opts[:debug_body]
75
+
76
+ # return_type
77
+ return_type = opts[:debug_return_type] || 'Transaction'
78
+
79
+ # auth_names
80
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
81
+
82
+ new_options = opts.merge(
83
+ :operation => :"WithdrawalsApi.get_withdraw",
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type
90
+ )
91
+
92
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug "API called: WithdrawalsApi#get_withdraw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95
+ end
96
+ return data, status_code, headers
97
+ end
98
+
99
+ # Get Withdrawal Receipt
100
+ # 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.
101
+ # @param id [String] Transaction ID.
102
+ # @param [Hash] opts the optional parameters
103
+ # @option opts [String] :type Return format. (default to 'pdf')
104
+ # @return [ProofResponse]
105
+ def get_withdraw_proof(id, opts = {})
106
+ data, _status_code, _headers = get_withdraw_proof_with_http_info(id, opts)
107
+ data
108
+ end
109
+
110
+ # Get Withdrawal Receipt
111
+ # Returns the transaction receipt. By default (&#x60;type&#x3D;pdf&#x60;) the response is the PDF file; with &#x60;type&#x3D;base64&#x60; it is JSON with the &#x60;base64&#x60; field, the PDF as a data URI.
112
+ # @param id [String] Transaction ID.
113
+ # @param [Hash] opts the optional parameters
114
+ # @option opts [String] :type Return format. (default to 'pdf')
115
+ # @return [Array<(ProofResponse, Integer, Hash)>] ProofResponse data, response status code and response headers
116
+ def get_withdraw_proof_with_http_info(id, opts = {})
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: WithdrawalsApi.get_withdraw_proof ...'
119
+ end
120
+ # verify the required parameter 'id' is set
121
+ if @api_client.config.client_side_validation && id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'id' when calling WithdrawalsApi.get_withdraw_proof"
123
+ end
124
+ allowable_values = ["pdf", "base64"]
125
+ if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
126
+ fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
127
+ end
128
+ # resource path
129
+ local_var_path = '/withdraw/proof/{id}'.sub('{id}', CGI.escape(id.to_s))
130
+
131
+ # query parameters
132
+ query_params = opts[:query_params] || {}
133
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
134
+
135
+ # header parameters
136
+ header_params = opts[:header_params] || {}
137
+ # HTTP header 'Accept' (if needed)
138
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/pdf']) unless header_params['Accept']
139
+
140
+ # form parameters
141
+ form_params = opts[:form_params] || {}
142
+
143
+ # http body (model)
144
+ post_body = opts[:debug_body]
145
+
146
+ # return_type
147
+ return_type = opts[:debug_return_type] || 'ProofResponse'
148
+
149
+ # auth_names
150
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
151
+
152
+ new_options = opts.merge(
153
+ :operation => :"WithdrawalsApi.get_withdraw_proof",
154
+ :header_params => header_params,
155
+ :query_params => query_params,
156
+ :form_params => form_params,
157
+ :body => post_body,
158
+ :auth_names => auth_names,
159
+ :return_type => return_type
160
+ )
161
+
162
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
163
+ if @api_client.config.debugging
164
+ @api_client.config.logger.debug "API called: WithdrawalsApi#get_withdraw_proof\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
165
+ end
166
+ return data, status_code, headers
167
+ end
168
+
169
+ # Create Withdrawal (Pix key)
170
+ # Send a Pix **cash out** to the specified Pix key. Token permission: `WITHDRAW`.
171
+ # @param post_withdraw_request [PostWithdrawRequest]
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Transaction]
174
+ def post_withdraw(post_withdraw_request, opts = {})
175
+ data, _status_code, _headers = post_withdraw_with_http_info(post_withdraw_request, opts)
176
+ data
177
+ end
178
+
179
+ # Create Withdrawal (Pix key)
180
+ # Send a Pix **cash out** to the specified Pix key. Token permission: &#x60;WITHDRAW&#x60;.
181
+ # @param post_withdraw_request [PostWithdrawRequest]
182
+ # @param [Hash] opts the optional parameters
183
+ # @return [Array<(Transaction, Integer, Hash)>] Transaction data, response status code and response headers
184
+ def post_withdraw_with_http_info(post_withdraw_request, opts = {})
185
+ if @api_client.config.debugging
186
+ @api_client.config.logger.debug 'Calling API: WithdrawalsApi.post_withdraw ...'
187
+ end
188
+ # verify the required parameter 'post_withdraw_request' is set
189
+ if @api_client.config.client_side_validation && post_withdraw_request.nil?
190
+ fail ArgumentError, "Missing the required parameter 'post_withdraw_request' when calling WithdrawalsApi.post_withdraw"
191
+ end
192
+ # resource path
193
+ local_var_path = '/withdraw'
194
+
195
+ # query parameters
196
+ query_params = opts[:query_params] || {}
197
+
198
+ # header parameters
199
+ header_params = opts[:header_params] || {}
200
+ # HTTP header 'Accept' (if needed)
201
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
202
+ # HTTP header 'Content-Type'
203
+ content_type = @api_client.select_header_content_type(['application/json'])
204
+ if !content_type.nil?
205
+ header_params['Content-Type'] = content_type
206
+ end
207
+
208
+ # form parameters
209
+ form_params = opts[:form_params] || {}
210
+
211
+ # http body (model)
212
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_withdraw_request)
213
+
214
+ # return_type
215
+ return_type = opts[:debug_return_type] || 'Transaction'
216
+
217
+ # auth_names
218
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
219
+
220
+ new_options = opts.merge(
221
+ :operation => :"WithdrawalsApi.post_withdraw",
222
+ :header_params => header_params,
223
+ :query_params => query_params,
224
+ :form_params => form_params,
225
+ :body => post_body,
226
+ :auth_names => auth_names,
227
+ :return_type => return_type
228
+ )
229
+
230
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
231
+ if @api_client.config.debugging
232
+ @api_client.config.logger.debug "API called: WithdrawalsApi#post_withdraw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ end
234
+ return data, status_code, headers
235
+ end
236
+
237
+ # Create Withdrawal using QR Code
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
+ # @param post_withdraw_qrcode_request [PostWithdrawQrcodeRequest]
240
+ # @param [Hash] opts the optional parameters
241
+ # @return [Transaction]
242
+ def post_withdraw_qrcode(post_withdraw_qrcode_request, opts = {})
243
+ data, _status_code, _headers = post_withdraw_qrcode_with_http_info(post_withdraw_qrcode_request, opts)
244
+ data
245
+ end
246
+
247
+ # Create Withdrawal using QR Code
248
+ # Cash out using a **Pix QR Code** (static/dynamic). If &#x60;amount&#x60; is not provided, the QR Code&#39;s embedded value will be used. PayZu processes both dynamic and static QR Codes. Token permission: &#x60;WITHDRAW&#x60;.
249
+ # @param post_withdraw_qrcode_request [PostWithdrawQrcodeRequest]
250
+ # @param [Hash] opts the optional parameters
251
+ # @return [Array<(Transaction, Integer, Hash)>] Transaction data, response status code and response headers
252
+ def post_withdraw_qrcode_with_http_info(post_withdraw_qrcode_request, opts = {})
253
+ if @api_client.config.debugging
254
+ @api_client.config.logger.debug 'Calling API: WithdrawalsApi.post_withdraw_qrcode ...'
255
+ end
256
+ # verify the required parameter 'post_withdraw_qrcode_request' is set
257
+ if @api_client.config.client_side_validation && post_withdraw_qrcode_request.nil?
258
+ fail ArgumentError, "Missing the required parameter 'post_withdraw_qrcode_request' when calling WithdrawalsApi.post_withdraw_qrcode"
259
+ end
260
+ # resource path
261
+ local_var_path = '/withdraw/qrcode'
262
+
263
+ # query parameters
264
+ query_params = opts[:query_params] || {}
265
+
266
+ # header parameters
267
+ header_params = opts[:header_params] || {}
268
+ # HTTP header 'Accept' (if needed)
269
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
270
+ # HTTP header 'Content-Type'
271
+ content_type = @api_client.select_header_content_type(['application/json'])
272
+ if !content_type.nil?
273
+ header_params['Content-Type'] = content_type
274
+ end
275
+
276
+ # form parameters
277
+ form_params = opts[:form_params] || {}
278
+
279
+ # http body (model)
280
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_withdraw_qrcode_request)
281
+
282
+ # return_type
283
+ return_type = opts[:debug_return_type] || 'Transaction'
284
+
285
+ # auth_names
286
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
287
+
288
+ new_options = opts.merge(
289
+ :operation => :"WithdrawalsApi.post_withdraw_qrcode",
290
+ :header_params => header_params,
291
+ :query_params => query_params,
292
+ :form_params => form_params,
293
+ :body => post_body,
294
+ :auth_names => auth_names,
295
+ :return_type => return_type
296
+ )
297
+
298
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug "API called: WithdrawalsApi#post_withdraw_qrcode\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
301
+ end
302
+ return data, status_code, headers
303
+ end
304
+ end
305
+ end