Class: TreezorClient::WalletApi

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/api/wallet_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WalletApi

Returns a new instance of WalletApi.



19
20
21
# File 'lib/treezor_client/api/wallet_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/treezor_client/api/wallet_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_wallet(id, origin, opts = {}) ⇒ InlineResponse20028

delete a wallet Change wallet’s status to CANCELED.

Parameters:

  • id

    Wallet's id

  • origin

    Request's origin. Possible values are: * OPERATOR * USER

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user's id is used for user's action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user's ip is used for user's action restriction. More info [here](agent.treezor.com/basics).

Returns:



32
33
34
35
# File 'lib/treezor_client/api/wallet_api.rb', line 32

def delete_wallet(id, origin, opts = {})
  data, _status_code, _headers = delete_wallet_with_http_info(id, origin, opts)
  data
end

#delete_wallet_with_http_info(id, origin, opts = {}) ⇒ Array<(InlineResponse20028, Fixnum, Hash)>

delete a wallet Change wallet&#39;s status to CANCELED.

Parameters:

  • id

    Wallet&#39;s id

  • origin

    Request&#39;s origin. Possible values are: * OPERATOR * USER

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

Returns:

  • (Array<(InlineResponse20028, Fixnum, Hash)>)

    InlineResponse20028 data, response status code and response headers



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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/treezor_client/api/wallet_api.rb', line 47

def delete_wallet_with_http_info(id, origin, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.delete_wallet ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WalletApi.delete_wallet"
  end
  # verify the required parameter 'origin' is set
  if @api_client.config.client_side_validation && origin.nil?
    fail ArgumentError, "Missing the required parameter 'origin' when calling WalletApi.delete_wallet"
  end
  # resource path
  local_var_path = '/wallets/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'origin'] = origin
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?

  # 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 = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20028')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#delete_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallet(id, opts = {}) ⇒ InlineResponse20028

get a wallet

Parameters:

  • id

    Object internal id.

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

Returns:



104
105
106
107
# File 'lib/treezor_client/api/wallet_api.rb', line 104

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

#get_wallet_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20028, Fixnum, Hash)>

get a wallet

Parameters:

  • id

    Object internal id.

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

Returns:

  • (Array<(InlineResponse20028, Fixnum, Hash)>)

    InlineResponse20028 data, response status code and response headers



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
158
159
160
# File 'lib/treezor_client/api/wallet_api.rb', line 118

def get_wallet_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WalletApi.get_wallet"
  end
  # resource path
  local_var_path = '/wallets/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?

  # 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 = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20028')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallets(opts = {}) ⇒ InlineResponse20028

search wallets Get wallets from the system that match the search criteria. The request must contains at least one of those inputs :walletId eventAlias, userId, walletTypeId, walletTag

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (Integer)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :wallet_id (Integer)

    Wallet&#39;s unique id.

  • :wallet_status (String)

    Wallet&#39;s status: * validated: Wallet is active. It is possible to deposit to or retrieve money from the wallet. * cancelled: Wallet is closed. No action possible, there is no money in the wallet, it was closed by an operator or by the user. * pending: Wallet being validated (e.g. suspected fraud, late submission of documents&#39; validation … KYC ). In this case, it is not possible to use the wallet for transactions.

  • :user_id (Integer)

    Wallet owner&#39;s id.

  • :parent_user_id (Integer)

    Parent user id of the wallet owner

  • :wallet_tag (String)

    Custom data.

  • :wallet_type_id (Integer)

    Wallet type id. The following values are defined: | Id | Description | |—-|—-| | 9 | Electronic Money Wallet | | 10 | Payment Account Wallet | | 13 | Mirror Wallet | | 14 | Electronic Money Card (Internal only) |

  • :event_alias (String)

    Short url wallet name. It&#39;s automatically generated by the system, but it could be modified and customised by the user. For example: www.domain.com/wallet&#x3D;mywedding

  • :event_payin_start_date (DateTime)

    Wallet activation date. The date from which you can deposit money on the wallet. Format : YYYY-MM-DD HH:MM:SS

  • :event_payin_end_date (DateTime)

    Deadline to money deposit on the wallet. Format : YYYY-MM-DD HH:MM:SS

  • :tariff_id (Integer)

    Wallet pricing id.

  • :payin_count (Integer)

    Number of payin done on the wallet.

  • :page_number (Integer)

    Pagination page number. More info [here](agent.treezor.com/lists).

  • :page_count (Integer)

    The number of items per page. More info [here](agent.treezor.com/lists).

  • :sort_by (String)

    The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists).

  • :sort_order (String)

    The order you want to sort the list. * DESC for a descending sort * ASC for a ascending sort. Default value : DESC. More info [here](agent.treezor.com/lists).

  • :created_date_from (DateTime)

    The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :created_date_to (DateTime)

    The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_from (DateTime)

    The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_to (DateTime)

    The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

Returns:



188
189
190
191
# File 'lib/treezor_client/api/wallet_api.rb', line 188

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

#get_wallets_with_http_info(opts = {}) ⇒ Array<(InlineResponse20028, Fixnum, Hash)>

search wallets Get wallets from the system that match the search criteria. The request must contains at least one of those inputs :walletId eventAlias, userId, walletTypeId, walletTag

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (Integer)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :wallet_id (Integer)

    Wallet&#39;s unique id.

  • :wallet_status (String)

    Wallet&#39;s status: * validated: Wallet is active. It is possible to deposit to or retrieve money from the wallet. * cancelled: Wallet is closed. No action possible, there is no money in the wallet, it was closed by an operator or by the user. * pending: Wallet being validated (e.g. suspected fraud, late submission of documents&#39; validation … KYC ). In this case, it is not possible to use the wallet for transactions.

  • :user_id (Integer)

    Wallet owner&#39;s id.

  • :parent_user_id (Integer)

    Parent user id of the wallet owner

  • :wallet_tag (String)

    Custom data.

  • :wallet_type_id (Integer)

    Wallet type id. The following values are defined: | Id | Description | |—-|—-| | 9 | Electronic Money Wallet | | 10 | Payment Account Wallet | | 13 | Mirror Wallet | | 14 | Electronic Money Card (Internal only) |

  • :event_alias (String)

    Short url wallet name. It&#39;s automatically generated by the system, but it could be modified and customised by the user. For example: www.domain.com/wallet&#x3D;mywedding

  • :event_payin_start_date (DateTime)

    Wallet activation date. The date from which you can deposit money on the wallet. Format : YYYY-MM-DD HH:MM:SS

  • :event_payin_end_date (DateTime)

    Deadline to money deposit on the wallet. Format : YYYY-MM-DD HH:MM:SS

  • :tariff_id (Integer)

    Wallet pricing id.

  • :payin_count (Integer)

    Number of payin done on the wallet.

  • :page_number (Integer)

    Pagination page number. More info [here](agent.treezor.com/lists).

  • :page_count (Integer)

    The number of items per page. More info [here](agent.treezor.com/lists).

  • :sort_by (String)

    The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists).

  • :sort_order (String)

    The order you want to sort the list. * DESC for a descending sort * ASC for a ascending sort. Default value : DESC. More info [here](agent.treezor.com/lists).

  • :created_date_from (DateTime)

    The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :created_date_to (DateTime)

    The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_from (DateTime)

    The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_to (DateTime)

    The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

Returns:

  • (Array<(InlineResponse20028, Fixnum, Hash)>)

    InlineResponse20028 data, response status code and response headers



220
221
222
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/treezor_client/api/wallet_api.rb', line 220

def get_wallets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_wallets ...'
  end
  # resource path
  local_var_path = '/wallets'

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIP'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'walletId'] = opts[:'wallet_id'] if !opts[:'wallet_id'].nil?
  query_params[:'walletStatus'] = opts[:'wallet_status'] if !opts[:'wallet_status'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'parentUserId'] = opts[:'parent_user_id'] if !opts[:'parent_user_id'].nil?
  query_params[:'walletTag'] = opts[:'wallet_tag'] if !opts[:'wallet_tag'].nil?
  query_params[:'walletTypeId'] = opts[:'wallet_type_id'] if !opts[:'wallet_type_id'].nil?
  query_params[:'eventAlias'] = opts[:'event_alias'] if !opts[:'event_alias'].nil?
  query_params[:'eventPayinStartDate'] = opts[:'event_payin_start_date'] if !opts[:'event_payin_start_date'].nil?
  query_params[:'eventPayinEndDate'] = opts[:'event_payin_end_date'] if !opts[:'event_payin_end_date'].nil?
  query_params[:'tariffId'] = opts[:'tariff_id'] if !opts[:'tariff_id'].nil?
  query_params[:'payinCount'] = opts[:'payin_count'] if !opts[:'payin_count'].nil?
  query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'pageCount'] = opts[:'page_count'] if !opts[:'page_count'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'createdDateFrom'] = opts[:'created_date_from'] if !opts[:'created_date_from'].nil?
  query_params[:'createdDateTo'] = opts[:'created_date_to'] if !opts[:'created_date_to'].nil?
  query_params[:'updatedDateFrom'] = opts[:'updated_date_from'] if !opts[:'updated_date_from'].nil?
  query_params[:'updatedDateTo'] = opts[:'updated_date_to'] if !opts[:'updated_date_to'].nil?

  # 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 = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20028')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_wallets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_wallets(wallet_type_id, tariff_id, user_id, currency, event_name, opts = {}) ⇒ InlineResponse20028

create a wallet Create a new wallet in the system..

Parameters:

  • wallet_type_id

    Wallet type id. The following values are defined: | Id | Description | |—-|—-| | 9 | Electronic Money Wallet | | 10 | Payment Account Wallet | | 13 | Mirror Wallet | | 14 | Electronic Money Card (Internal only) |

  • tariff_id

    Wallet pricing id.

  • user_id

    Wallet owner&#39;s id.

  • currency

    The currency that will be used for all wallet money transactions format : ISO 4217 3-letter code for each currency : Euro &#x3D; EUR ; US Dollar &#x3D; USD … Default currency will be same as the wallet

  • event_name

    Event name that will be used as wallet name. For example, in a wedding list: Wedding of X and Y

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (Integer)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :joint_user_id (Integer)

    Wallet co-owner&#39;s id. This user will not be allowed to collect the money from the wallet.

  • :wallet_tag (String)

    Custom data

  • :event_alias (String)

    Short url wallet name. It&#39;s automatically generated by the system, but it could be modified and customised by the user. For example: www.domain.com/wallet&#x3D;mywedding. Please note that the eventAlias must be unique.

  • :event_date (Date)

    Wallet event date. Format : YYYY-MM-DD. Default: Created date + 7 days.

  • :event_message (String)

    It can be a description of the wallet.

  • :event_payin_start_date (Date)

    Wallet activation date. The date from which you can deposit money on the wallet. Format : YYYY-MM-DD. If null, the default date will be the created date of the wallet.

  • :event_payin_end_date (Date)

    Deadline to money deposit on the wallet. Format : YYYY-MM-DD. If null, the money can be deposited indefinitely on the wallet

Returns:



298
299
300
301
# File 'lib/treezor_client/api/wallet_api.rb', line 298

def post_wallets(wallet_type_id, tariff_id, user_id, currency, event_name, opts = {})
  data, _status_code, _headers = post_wallets_with_http_info(wallet_type_id, tariff_id, user_id, currency, event_name, opts)
  data
end

#post_wallets_with_http_info(wallet_type_id, tariff_id, user_id, currency, event_name, opts = {}) ⇒ Array<(InlineResponse20028, Fixnum, Hash)>

create a wallet Create a new wallet in the system..

Parameters:

  • wallet_type_id

    Wallet type id. The following values are defined: | Id | Description | |—-|—-| | 9 | Electronic Money Wallet | | 10 | Payment Account Wallet | | 13 | Mirror Wallet | | 14 | Electronic Money Card (Internal only) |

  • tariff_id

    Wallet pricing id.

  • user_id

    Wallet owner&#39;s id.

  • currency

    The currency that will be used for all wallet money transactions format : ISO 4217 3-letter code for each currency : Euro &#x3D; EUR ; US Dollar &#x3D; USD … Default currency will be same as the wallet

  • event_name

    Event name that will be used as wallet name. For example, in a wedding list: Wedding of X and Y

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (Integer)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :joint_user_id (Integer)

    Wallet co-owner&#39;s id. This user will not be allowed to collect the money from the wallet.

  • :wallet_tag (String)

    Custom data

  • :event_alias (String)

    Short url wallet name. It&#39;s automatically generated by the system, but it could be modified and customised by the user. For example: www.domain.com/wallet&#x3D;mywedding. Please note that the eventAlias must be unique.

  • :event_date (Date)

    Wallet event date. Format : YYYY-MM-DD. Default: Created date + 7 days.

  • :event_message (String)

    It can be a description of the wallet.

  • :event_payin_start_date (Date)

    Wallet activation date. The date from which you can deposit money on the wallet. Format : YYYY-MM-DD. If null, the default date will be the created date of the wallet.

  • :event_payin_end_date (Date)

    Deadline to money deposit on the wallet. Format : YYYY-MM-DD. If null, the money can be deposited indefinitely on the wallet

Returns:

  • (Array<(InlineResponse20028, Fixnum, Hash)>)

    InlineResponse20028 data, response status code and response headers



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/treezor_client/api/wallet_api.rb', line 323

def post_wallets_with_http_info(wallet_type_id, tariff_id, user_id, currency, event_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.post_wallets ...'
  end
  # verify the required parameter 'wallet_type_id' is set
  if @api_client.config.client_side_validation && wallet_type_id.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_type_id' when calling WalletApi.post_wallets"
  end
  # verify the required parameter 'tariff_id' is set
  if @api_client.config.client_side_validation && tariff_id.nil?
    fail ArgumentError, "Missing the required parameter 'tariff_id' when calling WalletApi.post_wallets"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling WalletApi.post_wallets"
  end
  # verify the required parameter 'currency' is set
  if @api_client.config.client_side_validation && currency.nil?
    fail ArgumentError, "Missing the required parameter 'currency' when calling WalletApi.post_wallets"
  end
  # verify the required parameter 'event_name' is set
  if @api_client.config.client_side_validation && event_name.nil?
    fail ArgumentError, "Missing the required parameter 'event_name' when calling WalletApi.post_wallets"
  end
  # resource path
  local_var_path = '/wallets'

  # query parameters
  query_params = {}
  query_params[:'walletTypeId'] = wallet_type_id
  query_params[:'tariffId'] = tariff_id
  query_params[:'userId'] = user_id
  query_params[:'currency'] = currency
  query_params[:'eventName'] = event_name
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIP'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'jointUserId'] = opts[:'joint_user_id'] if !opts[:'joint_user_id'].nil?
  query_params[:'walletTag'] = opts[:'wallet_tag'] if !opts[:'wallet_tag'].nil?
  query_params[:'eventAlias'] = opts[:'event_alias'] if !opts[:'event_alias'].nil?
  query_params[:'eventDate'] = opts[:'event_date'] if !opts[:'event_date'].nil?
  query_params[:'eventMessage'] = opts[:'event_message'] if !opts[:'event_message'].nil?
  query_params[:'eventPayinStartDate'] = opts[:'event_payin_start_date'] if !opts[:'event_payin_start_date'].nil?
  query_params[:'eventPayinEndDate'] = opts[:'event_payin_end_date'] if !opts[:'event_payin_end_date'].nil?

  # 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 = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20028')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#post_wallets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_wallet(id, opts = {}) ⇒ InlineResponse20028

update a wallet Modifiy wallet information

Parameters:

  • id

    Object internal id.

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :wallet_type_id (String)

    Change wallet type id

  • :event_name (String)

    Change event name

  • :event_alias (String)

    Change event alias. Please note that the eventAlias must be unique.

  • :event_date (String)

    Change event date

  • :event_message (String)

    Change event message

  • :event_payin_start_date (String)

    Change event payin starting date

  • :event_payin_end_date (String)

    Change event payin end date

  • :url_image (String)

    Change URL image

  • :image_name (String)

    Change image name

  • :tariff_id (String)

    Change tariff id

Returns:



413
414
415
416
# File 'lib/treezor_client/api/wallet_api.rb', line 413

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

#put_wallet_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20028, Fixnum, Hash)>

update a wallet Modifiy wallet information

Parameters:

  • id

    Object internal id.

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :wallet_type_id (String)

    Change wallet type id

  • :event_name (String)

    Change event name

  • :event_alias (String)

    Change event alias. Please note that the eventAlias must be unique.

  • :event_date (String)

    Change event date

  • :event_message (String)

    Change event message

  • :event_payin_start_date (String)

    Change event payin starting date

  • :event_payin_end_date (String)

    Change event payin end date

  • :url_image (String)

    Change URL image

  • :image_name (String)

    Change image name

  • :tariff_id (String)

    Change tariff id

Returns:

  • (Array<(InlineResponse20028, Fixnum, Hash)>)

    InlineResponse20028 data, response status code and response headers



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
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
# File 'lib/treezor_client/api/wallet_api.rb', line 437

def put_wallet_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.put_wallet ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WalletApi.put_wallet"
  end
  # resource path
  local_var_path = '/wallets/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'walletTypeId'] = opts[:'wallet_type_id'] if !opts[:'wallet_type_id'].nil?
  query_params[:'eventName'] = opts[:'event_name'] if !opts[:'event_name'].nil?
  query_params[:'eventAlias'] = opts[:'event_alias'] if !opts[:'event_alias'].nil?
  query_params[:'eventDate'] = opts[:'event_date'] if !opts[:'event_date'].nil?
  query_params[:'eventMessage'] = opts[:'event_message'] if !opts[:'event_message'].nil?
  query_params[:'eventPayinStartDate'] = opts[:'event_payin_start_date'] if !opts[:'event_payin_start_date'].nil?
  query_params[:'eventPayinEndDate'] = opts[:'event_payin_end_date'] if !opts[:'event_payin_end_date'].nil?
  query_params[:'urlImage'] = opts[:'url_image'] if !opts[:'url_image'].nil?
  query_params[:'imageName'] = opts[:'image_name'] if !opts[:'image_name'].nil?
  query_params[:'tariffId'] = opts[:'tariff_id'] if !opts[:'tariff_id'].nil?

  # 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 = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20028')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#put_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end