Class: MassPayRubySdk::AccountApi

Inherits:
Object
  • Object
show all
Defined in:
lib/masspay_ruby_sdk/api/account_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountApi

Returns a new instance of AccountApi.



18
19
20
# File 'lib/masspay_ruby_sdk/api/account_api.rb', line 18

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/masspay_ruby_sdk/api/account_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#get_account_balance(opts = {}) ⇒ Array<AvailableBalanceTxnResp>

Get current available balance This GET endpoint is used to retrieve the current available balance for the MassPay account.
You can use this endpoint to obtain information about the current balance in your account.
There are no required parameters needed to access this endpoint.
The response will include a JSON objects containing details for the current available balance, including the token, balance and currency_code.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



25
26
27
28
# File 'lib/masspay_ruby_sdk/api/account_api.rb', line 25

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end

#get_account_balance_with_http_info(opts = {}) ⇒ Array<(Array<AvailableBalanceTxnResp>, Integer, Hash)>

Get current available balance This GET endpoint is used to retrieve the current available balance for the MassPay account. &lt;br&gt; You can use this endpoint to obtain information about the current balance in your account. &lt;br&gt; There are no required parameters needed to access this endpoint. &lt;br&gt; The response will include a JSON objects containing details for the current available balance, including the token, balance and &#x60;currency_code&#x60;.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<AvailableBalanceTxnResp>, Integer, Hash)>)

    Array<AvailableBalanceTxnResp> data, response status code and response headers



34
35
36
37
38
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
# File 'lib/masspay_ruby_sdk/api/account_api.rb', line 34

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_account_balance ...'
  end
  # resource path
  local_var_path = '/account/balance'

  # 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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<AvailableBalanceTxnResp>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']

  new_options = opts.merge(
    :operation => :"AccountApi.get_account_balance",
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_account_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_statement(start_date, ending_date, opts = {}) ⇒ GetAccountStatement200Response

Get certified account statement This GET endpoint is used to retrieve a certified PDF ledger statement for a provided timeframe.
You can use this endpoint to obtain a ledger statement for your MassPay account for a specific time period.
To use this endpoint, you need to provide the start_date and ending_date as required parameters in the Query string of the URL.
The response will include a certified PDF ledger statement containing transaction details for the specified timeframe.

Parameters:

  • start_date (Date)

    Starting date of the statement

  • ending_date (Date)

    Ending date of the statement (not more than 31 days than &#x60;start_date&#x60;)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



84
85
86
87
# File 'lib/masspay_ruby_sdk/api/account_api.rb', line 84

def (start_date, ending_date, opts = {})
  data, _status_code, _headers = (start_date, ending_date, opts)
  data
end

#get_account_statement_with_http_info(start_date, ending_date, opts = {}) ⇒ Array<(GetAccountStatement200Response, Integer, Hash)>

Get certified account statement This GET endpoint is used to retrieve a certified PDF ledger statement for a provided timeframe. &lt;br&gt; You can use this endpoint to obtain a ledger statement for your MassPay account for a specific time period. &lt;br&gt; To use this endpoint, you need to provide the &#x60;start_date&#x60; and &#x60;ending_date&#x60; as required parameters in the Query string of the URL. &lt;br&gt; The response will include a certified PDF ledger statement containing transaction details for the specified timeframe.

Parameters:

  • start_date (Date)

    Starting date of the statement

  • ending_date (Date)

    Ending date of the statement (not more than 31 days than &#x60;start_date&#x60;)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/masspay_ruby_sdk/api/account_api.rb', line 95

def (start_date, ending_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_account_statement ...'
  end
  # verify the required parameter 'start_date' is set
  if @api_client.config.client_side_validation && start_date.nil?
    fail ArgumentError, "Missing the required parameter 'start_date' when calling AccountApi.get_account_statement"
  end
  # verify the required parameter 'ending_date' is set
  if @api_client.config.client_side_validation && ending_date.nil?
    fail ArgumentError, "Missing the required parameter 'ending_date' when calling AccountApi.get_account_statement"
  end
  # resource path
  local_var_path = '/account/statement'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_date'] = start_date
  query_params[:'ending_date'] = ending_date

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAccountStatement200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['AUTHORIZER_NAME']

  new_options = opts.merge(
    :operation => :"AccountApi.get_account_statement",
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_account_statement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end