Class: TransferZero::TransactionsApi
- Inherits:
-
Object
- Object
- TransferZero::TransactionsApi
- Defined in:
- lib/transferzero-sdk/api/transactions_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#calculate_transactions(transaction_request, opts = {}) ⇒ TransactionResponse
Calculates transaction amounts for a transaction payload Calculates the input, output and fee amounts for the recipients in a transaction payload.
-
#calculate_transactions_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Calculates transaction amounts for a transaction payload Calculates the input, output and fee amounts for the recipients in a transaction payload.
-
#create_and_fund_transaction(transaction_request, opts = {}) ⇒ TransactionResponse
Creates a new transaction and funds it from account balance This endpoint creates a transaction and funds it from an account balance.
-
#create_and_fund_transaction_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a new transaction and funds it from account balance This endpoint creates a transaction and funds it from an account balance.
-
#get_transaction(transaction_id, opts = {}) ⇒ TransactionResponse
Fetch a single transaction Finds and returns a Transaction created by the requesting API key, using the provided Transaction ID.
-
#get_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Fetch a single transaction Finds and returns a Transaction created by the requesting API key, using the provided Transaction ID.
-
#get_transactions(opts = {}) ⇒ TransactionListResponse
Get a list of transactions Retrieves a paginated list of the Transactions created by your API key.
- #get_transactions_all(opts = {}) ⇒ Object
-
#get_transactions_with_http_info(opts = {}) ⇒ Array<(TransactionListResponse, Fixnum, Hash)>
Get a list of transactions Retrieves a paginated list of the Transactions created by your API key.
-
#initialize(api_client = ApiClient.default) ⇒ TransactionsApi
constructor
A new instance of TransactionsApi.
-
#payin_transaction(transaction_id, payin_method_request, opts = {}) ⇒ TransactionResponse
Creates a fake payin for transaction This method is available only in sandbox environment and is supposed to be used only for testing integration.
-
#payin_transaction_with_http_info(transaction_id, payin_method_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a fake payin for transaction This method is available only in sandbox environment and is supposed to be used only for testing integration.
-
#payout_transaction(transaction_id, opts = {}) ⇒ TransactionResponse
Creates a fake payout for transaction This method is available only in sandbox environment and is supposed to be used only for testing.
-
#payout_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a fake payout for transaction This method is available only in sandbox environment and is supposed to be used only for testing.
-
#post_transactions(transaction_request, opts = {}) ⇒ TransactionResponse
Creates a new transaction Transactions are the main objects in the TransferZero API, so it’s important to understand how to create and manage them.
-
#post_transactions_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a new transaction Transactions are the main objects in the TransferZero API, so it's important to understand how to create and manage them.
-
#validate_transactions(transaction_request, opts = {}) ⇒ TransactionResponse
Validates a transaction payload Validates fields in a transaction payload and displays invalid or missing fields.
-
#validate_transactions_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Validates a transaction payload Validates fields in a transaction payload and displays invalid or missing fields.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TransactionsApi
Returns a new instance of TransactionsApi.
19 20 21 |
# File 'lib/transferzero-sdk/api/transactions_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/transactions_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#calculate_transactions(transaction_request, opts = {}) ⇒ TransactionResponse
Calculates transaction amounts for a transaction payload Calculates the input, output and fee amounts for the recipients in a transaction payload
29 30 31 32 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 29 def calculate_transactions(transaction_request, opts = {}) data, _status_code, _headers = calculate_transactions_with_http_info(transaction_request, opts) data end |
#calculate_transactions_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Calculates transaction amounts for a transaction payload Calculates the input, output and fee amounts for the recipients in a transaction payload
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 76 77 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 39 def calculate_transactions_with_http_info(transaction_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.calculate_transactions ...' end # verify the required parameter 'transaction_request' is set if @api_client.config.client_side_validation && transaction_request.nil? fail ArgumentError, "Missing the required parameter 'transaction_request' when calling TransactionsApi.calculate_transactions" end # resource path local_var_path = '/transactions/calculate' # 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(transaction_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#calculate_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_and_fund_transaction(transaction_request, opts = {}) ⇒ TransactionResponse
Creates a new transaction and funds it from account balance This endpoint creates a transaction and funds it from an account balance. You must ensure that you have established an account with us in the pay-in currency of the transactions you wish to create, and that this account is sufficently funded, before calling this endpoint. Note that the <pre>external_id</pre> field is required for requests to this endpoint.
85 86 87 88 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 85 def create_and_fund_transaction(transaction_request, opts = {}) data, _status_code, _headers = create_and_fund_transaction_with_http_info(transaction_request, opts) data end |
#create_and_fund_transaction_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a new transaction and funds it from account balance This endpoint creates a transaction and funds it from an account balance. You must ensure that you have established an account with us in the pay-in currency of the transactions you wish to create, and that this account is sufficently funded, before calling this endpoint. Note that the <pre>external_id</pre> field is required for requests to this endpoint.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 95 def create_and_fund_transaction_with_http_info(transaction_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.create_and_fund_transaction ...' end # verify the required parameter 'transaction_request' is set if @api_client.config.client_side_validation && transaction_request.nil? fail ArgumentError, "Missing the required parameter 'transaction_request' when calling TransactionsApi.create_and_fund_transaction" end # resource path local_var_path = '/transactions/create_and_fund' # 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(transaction_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#create_and_fund_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transaction(transaction_id, opts = {}) ⇒ TransactionResponse
Fetch a single transaction Finds and returns a Transaction created by the requesting API key, using the provided Transaction ID.
141 142 143 144 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 141 def get_transaction(transaction_id, opts = {}) data, _status_code, _headers = get_transaction_with_http_info(transaction_id, opts) data end |
#get_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Fetch a single transaction Finds and returns a Transaction created by the requesting API key, using the provided Transaction ID.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 151 def get_transaction_with_http_info(transaction_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transaction ...' end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.get_transaction" end # resource path local_var_path = '/transactions/{Transaction ID}'.sub('{' + 'Transaction ID' + '}', transaction_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 => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transactions(opts = {}) ⇒ TransactionListResponse
Get a list of transactions Retrieves a paginated list of the Transactions created by your API key.
209 210 211 212 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 209 def get_transactions(opts = {}) data, _status_code, _headers = get_transactions_with_http_info(opts) data end |
#get_transactions_all(opts = {}) ⇒ Object
189 190 191 192 193 194 195 196 197 198 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 189 def get_transactions_all(opts = {}) result = [] response = get_transactions(opts) result += response["object"] while next_page = response["meta"]["pagination"]["next_page"] response = get_transactions(opts.merge(page: next_page)) result += response["object"] end result end |
#get_transactions_with_http_info(opts = {}) ⇒ Array<(TransactionListResponse, Fixnum, Hash)>
Get a list of transactions Retrieves a paginated list of the Transactions created by your API key.
223 224 225 226 227 228 229 230 231 232 233 234 235 236 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 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 223 def get_transactions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions ...' end if @api_client.config.client_side_validation && opts[:'transactions_type'] && !['automated', 'manual'].include?(opts[:'transactions_type']) fail ArgumentError, 'invalid value for "transactions_type", must be one of automated, manual' end # resource path local_var_path = '/transactions' # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil? query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil? query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil? query_params[:'transactions_type'] = opts[:'transactions_type'] if !opts[:'transactions_type'].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 => 'TransactionListResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#payin_transaction(transaction_id, payin_method_request, opts = {}) ⇒ TransactionResponse
Creates a fake payin for transaction This method is available only in sandbox environment and is supposed to be used only for testing integration. It allows you to emulate a payin without paying actual money.
272 273 274 275 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 272 def (transaction_id, , opts = {}) data, _status_code, _headers = (transaction_id, , opts) data end |
#payin_transaction_with_http_info(transaction_id, payin_method_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a fake payin for transaction This method is available only in sandbox environment and is supposed to be used only for testing integration. It allows you to emulate a payin without paying actual money.
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 283 def (transaction_id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.payin_transaction ...' end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.payin_transaction" end # verify the required parameter 'payin_method_request' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'payin_method_request' when calling TransactionsApi.payin_transaction" end # resource path local_var_path = '/transactions/{Transaction ID}/payin'.sub('{' + 'Transaction ID' + '}', transaction_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() auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#payin_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#payout_transaction(transaction_id, opts = {}) ⇒ TransactionResponse
Creates a fake payout for transaction This method is available only in sandbox environment and is supposed to be used only for testing. It allows you to emulate the payout of a transaction after payin.
333 334 335 336 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 333 def payout_transaction(transaction_id, opts = {}) data, _status_code, _headers = payout_transaction_with_http_info(transaction_id, opts) data end |
#payout_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a fake payout for transaction This method is available only in sandbox environment and is supposed to be used only for testing. It allows you to emulate the payout of a transaction after payin.
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 343 def payout_transaction_with_http_info(transaction_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.payout_transaction ...' end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.payout_transaction" end # resource path local_var_path = '/transactions/{Transaction ID}/payout'.sub('{' + 'Transaction ID' + '}', transaction_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(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#payout_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_transactions(transaction_request, opts = {}) ⇒ TransactionResponse
Creates a new transaction Transactions are the main objects in the TransferZero API, so it’s important to understand how to create and manage them. Transactions facilitate money movement from one Sender in a specific currency to one or multiple Recipients in another currency. The main flow of a successful transaction flow is the following - - Transaction is created linking the Sender to the Recipient(s) with the requested amounts. - Once the sender is KYC’d and approved the transaction can be funded. - Once the transaction is funded, we will initiate the payout to the recipient(s). - After the recipient (or all recipients) has received the money, the transaction is finished.
387 388 389 390 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 387 def post_transactions(transaction_request, opts = {}) data, _status_code, _headers = post_transactions_with_http_info(transaction_request, opts) data end |
#post_transactions_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Creates a new transaction Transactions are the main objects in the TransferZero API, so it's important to understand how to create and manage them. Transactions facilitate money movement from one Sender in a specific currency to one or multiple Recipients in another currency. The main flow of a successful transaction flow is the following - - Transaction is created linking the Sender to the Recipient(s) with the requested amounts. - Once the sender is KYC'd and approved the transaction can be funded. - Once the transaction is funded, we will initiate the payout to the recipient(s). - After the recipient (or all recipients) has received the money, the transaction is finished.
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 397 def post_transactions_with_http_info(transaction_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.post_transactions ...' end # verify the required parameter 'transaction_request' is set if @api_client.config.client_side_validation && transaction_request.nil? fail ArgumentError, "Missing the required parameter 'transaction_request' when calling TransactionsApi.post_transactions" end # resource path local_var_path = '/transactions' # 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(transaction_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#post_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#validate_transactions(transaction_request, opts = {}) ⇒ TransactionResponse
Validates a transaction payload Validates fields in a transaction payload and displays invalid or missing fields
443 444 445 446 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 443 def validate_transactions(transaction_request, opts = {}) data, _status_code, _headers = validate_transactions_with_http_info(transaction_request, opts) data end |
#validate_transactions_with_http_info(transaction_request, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>
Validates a transaction payload Validates fields in a transaction payload and displays invalid or missing fields
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/transferzero-sdk/api/transactions_api.rb', line 453 def validate_transactions_with_http_info(transaction_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.validate_transactions ...' end # verify the required parameter 'transaction_request' is set if @api_client.config.client_side_validation && transaction_request.nil? fail ArgumentError, "Missing the required parameter 'transaction_request' when calling TransactionsApi.validate_transactions" end # resource path local_var_path = '/transactions/validate' # 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(transaction_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#validate_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |