Class: TransferZero::RecipientsApi
- Inherits:
-
Object
- Object
- TransferZero::RecipientsApi
- Defined in:
- lib/transferzero-sdk/api/recipients_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_recipient(recipient_id, opts = {}) ⇒ RecipientResponse
Cancelling a recipient Cancels the payment to the recipient specified in the URL path.
-
#delete_recipient_with_http_info(recipient_id, opts = {}) ⇒ Array<(RecipientResponse, Fixnum, Hash)>
Cancelling a recipient Cancels the payment to the recipient specified in the URL path.
-
#get_recipients(opts = {}) ⇒ RecipientListResponse
Getting a list of recipients with filtering Fetches details of all recipients.
- #get_recipients_all(opts = {}) ⇒ Object
-
#get_recipients_with_http_info(opts = {}) ⇒ Array<(RecipientListResponse, Fixnum, Hash)>
Getting a list of recipients with filtering Fetches details of all recipients.
-
#initialize(api_client = ApiClient.default) ⇒ RecipientsApi
constructor
A new instance of RecipientsApi.
-
#patch_recipient(recipient_id, recipient_request, opts = {}) ⇒ RecipientResponse
Updating a recipient Updates the recipient specified in the URL path.
-
#patch_recipient_with_http_info(recipient_id, recipient_request, opts = {}) ⇒ Array<(RecipientResponse, Fixnum, Hash)>
Updating a recipient Updates the recipient specified in the URL path.
-
#proof_of_payments(recipient_id, opts = {}) ⇒ ProofOfPaymentListResponse
Returns list of proof of payments Returns a list of uploaded proof of payment files for a transaction recipient.
-
#proof_of_payments_with_http_info(recipient_id, opts = {}) ⇒ Array<(ProofOfPaymentListResponse, Fixnum, Hash)>
Returns list of proof of payments Returns a list of uploaded proof of payment files for a transaction recipient.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ RecipientsApi
Returns a new instance of RecipientsApi.
19 20 21 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_recipient(recipient_id, opts = {}) ⇒ RecipientResponse
Cancelling a recipient Cancels the payment to the recipient specified in the URL path. Please note recipients where the ‘may_cancel` attribute is true will be cancelled immediately. If the `may_cancel` attribute is false you can still try to cancel the recipient, however it will only gets cancelled if we will receive a confirmation from our partner that the payment has failed
29 30 31 32 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 29 def delete_recipient(recipient_id, opts = {}) data, _status_code, _headers = delete_recipient_with_http_info(recipient_id, opts) data end |
#delete_recipient_with_http_info(recipient_id, opts = {}) ⇒ Array<(RecipientResponse, Fixnum, Hash)>
Cancelling a recipient Cancels the payment to the recipient specified in the URL path. Please note recipients where the `may_cancel` attribute is true will be cancelled immediately. If the `may_cancel` attribute is false you can still try to cancel the recipient, however it will only gets cancelled if we will receive a confirmation from our partner that the payment has failed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 39 def delete_recipient_with_http_info(recipient_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RecipientsApi.delete_recipient ...' end # verify the required parameter 'recipient_id' is set if @api_client.config.client_side_validation && recipient_id.nil? fail ArgumentError, "Missing the required parameter 'recipient_id' when calling RecipientsApi.delete_recipient" end # resource path local_var_path = '/recipients/{Recipient ID}'.sub('{' + 'Recipient ID' + '}', recipient_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RecipientResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: RecipientsApi#delete_recipient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_recipients(opts = {}) ⇒ RecipientListResponse
Getting a list of recipients with filtering Fetches details of all recipients.
100 101 102 103 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 100 def get_recipients(opts = {}) data, _status_code, _headers = get_recipients_with_http_info(opts) data end |
#get_recipients_all(opts = {}) ⇒ Object
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 77 def get_recipients_all(opts = {}) result = [] response = get_recipients(opts) result += response["object"] while next_page = response["meta"]["pagination"]["next_page"] response = get_recipients(opts.merge(page: next_page)) result += response["object"] end result end |
#get_recipients_with_http_info(opts = {}) ⇒ Array<(RecipientListResponse, Fixnum, Hash)>
Getting a list of recipients with filtering Fetches details of all recipients.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 117 def get_recipients_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RecipientsApi.get_recipients ...' end # resource path local_var_path = '/recipients' # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil? query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil? query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil? query_params[:'amount_from'] = opts[:'amount_from'] if !opts[:'amount_from'].nil? query_params[:'amount_to'] = opts[:'amount_to'] if !opts[:'amount_to'].nil? query_params[:'state'] = @api_client.build_collection_param(opts[:'state'], :multi) if !opts[:'state'].nil? query_params[:'currency'] = @api_client.build_collection_param(opts[:'currency'], :multi) if !opts[:'currency'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RecipientListResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: RecipientsApi#get_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch_recipient(recipient_id, recipient_request, opts = {}) ⇒ RecipientResponse
Updating a recipient Updates the recipient specified in the URL path. Please note that only recipients where the ‘editable` field is true can be modified. Once the recipient is modified any subsequent payout tries will be sent to the updated details.
166 167 168 169 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 166 def patch_recipient(recipient_id, recipient_request, opts = {}) data, _status_code, _headers = patch_recipient_with_http_info(recipient_id, recipient_request, opts) data end |
#patch_recipient_with_http_info(recipient_id, recipient_request, opts = {}) ⇒ Array<(RecipientResponse, Fixnum, Hash)>
Updating a recipient Updates the recipient specified in the URL path. Please note that only recipients where the `editable` field is true can be modified. Once the recipient is modified any subsequent payout tries will be sent to the updated details.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 177 def patch_recipient_with_http_info(recipient_id, recipient_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RecipientsApi.patch_recipient ...' end # verify the required parameter 'recipient_id' is set if @api_client.config.client_side_validation && recipient_id.nil? fail ArgumentError, "Missing the required parameter 'recipient_id' when calling RecipientsApi.patch_recipient" end # verify the required parameter 'recipient_request' is set if @api_client.config.client_side_validation && recipient_request.nil? fail ArgumentError, "Missing the required parameter 'recipient_request' when calling RecipientsApi.patch_recipient" end # resource path local_var_path = '/recipients/{Recipient ID}'.sub('{' + 'Recipient ID' + '}', recipient_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(recipient_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RecipientResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: RecipientsApi#patch_recipient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#proof_of_payments(recipient_id, opts = {}) ⇒ ProofOfPaymentListResponse
Returns list of proof of payments Returns a list of uploaded proof of payment files for a transaction recipient
227 228 229 230 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 227 def proof_of_payments(recipient_id, opts = {}) data, _status_code, _headers = proof_of_payments_with_http_info(recipient_id, opts) data end |
#proof_of_payments_with_http_info(recipient_id, opts = {}) ⇒ Array<(ProofOfPaymentListResponse, Fixnum, Hash)>
Returns list of proof of payments Returns a list of uploaded proof of payment files for a transaction recipient
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 237 def proof_of_payments_with_http_info(recipient_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RecipientsApi.proof_of_payments ...' end # verify the required parameter 'recipient_id' is set if @api_client.config.client_side_validation && recipient_id.nil? fail ArgumentError, "Missing the required parameter 'recipient_id' when calling RecipientsApi.proof_of_payments" end # resource path local_var_path = '/recipients/{Recipient ID}/proof_of_payments'.sub('{' + 'Recipient ID' + '}', recipient_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProofOfPaymentListResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: RecipientsApi#proof_of_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |