class Yapstone::DisbursementsApi
Attributes
Public Class Methods
# File lib/yapstone-payments/api/disbursements_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Change payment from "Hold payout" state to be ready for disbursement Disburse payment @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address
of the client @param payment_id [String] @param disbursement_requests [DisbursementRequests] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone
support. Can be any arbitrary string. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [PaymentResponse]
# File lib/yapstone-payments/api/disbursements_api.rb, line 32 def disburse_payment_by_id(authorization, x_yapstone_ip_address, payment_id, disbursement_requests, opts = {}) data, _status_code, _headers = disburse_payment_by_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, disbursement_requests, opts) data end
Change payment from "Hold payout" state to be ready for disbursement Disburse payment @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address
of the client @param payment_id [String] @param disbursement_requests [DisbursementRequests] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone
support. Can be any arbitrary string. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [Array<(PaymentResponse
, Integer, Hash)>] PaymentResponse
data, response status code and response headers
# File lib/yapstone-payments/api/disbursements_api.rb, line 47 def disburse_payment_by_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, disbursement_requests, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisbursementsApi.disburse_payment_by_id ...' end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && authorization.nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling DisbursementsApi.disburse_payment_by_id" end # verify the required parameter 'x_yapstone_ip_address' is set if @api_client.config.client_side_validation && x_yapstone_ip_address.nil? fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling DisbursementsApi.disburse_payment_by_id" end # verify the required parameter 'payment_id' is set if @api_client.config.client_side_validation && payment_id.nil? fail ArgumentError, "Missing the required parameter 'payment_id' when calling DisbursementsApi.disburse_payment_by_id" end # verify the required parameter 'disbursement_requests' is set if @api_client.config.client_side_validation && disbursement_requests.nil? fail ArgumentError, "Missing the required parameter 'disbursement_requests' when calling DisbursementsApi.disburse_payment_by_id" end # resource path local_var_path = '/v2/disbursements/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) header_params[:'Authorization'] = authorization header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil? header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(disbursement_requests) # return_type return_type = opts[:return_type] || 'PaymentResponse' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisbursementsApi#disburse_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Change transaction from "Hold payout" state to be ready for disbursement (payout) Provide the transaction ID for the transaction where you want to shift state so that money can finally be paid out (disbursed). @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address
of the client @param transaction_id [String] The identification number for the transaction you want to disburse. @param disburse_transaction_req [DisburseTransactionReq] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone
support. Can be any arbitrary string. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [PaymentResponse]
# File lib/yapstone-payments/api/disbursements_api.rb, line 122 def disburse_transaction_by_id(authorization, x_yapstone_ip_address, transaction_id, disburse_transaction_req, opts = {}) data, _status_code, _headers = disburse_transaction_by_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, disburse_transaction_req, opts) data end
Change transaction from "Hold payout" state to be ready for disbursement (payout) Provide the transaction ID for the transaction where you want to shift state so that money can finally be paid out (disbursed). @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address
of the client @param transaction_id [String] The identification number for the transaction you want to disburse. @param disburse_transaction_req [DisburseTransactionReq] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone
support. Can be any arbitrary string. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [Array<(PaymentResponse
, Integer, Hash)>] PaymentResponse
data, response status code and response headers
# File lib/yapstone-payments/api/disbursements_api.rb, line 137 def disburse_transaction_by_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, disburse_transaction_req, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DisbursementsApi.disburse_transaction_by_id ...' end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && authorization.nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling DisbursementsApi.disburse_transaction_by_id" end # verify the required parameter 'x_yapstone_ip_address' is set if @api_client.config.client_side_validation && x_yapstone_ip_address.nil? fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling DisbursementsApi.disburse_transaction_by_id" 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 DisbursementsApi.disburse_transaction_by_id" end # verify the required parameter 'disburse_transaction_req' is set if @api_client.config.client_side_validation && disburse_transaction_req.nil? fail ArgumentError, "Missing the required parameter 'disburse_transaction_req' when calling DisbursementsApi.disburse_transaction_by_id" end # resource path local_var_path = '/v2/disbursements/transaction/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) header_params[:'Authorization'] = authorization header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil? header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(disburse_transaction_req) # return_type return_type = opts[:return_type] || 'PaymentResponse' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DisbursementsApi#disburse_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end