Class: MassPayRubySdk::WalletApi

Inherits:
Object
  • Object
show all
Defined in:
lib/masspay_ruby_sdk/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.



18
19
20
# File 'lib/masspay_ruby_sdk/api/wallet_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/wallet_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#create_autopay_rule(user_token, wallet_token, opts = {}) ⇒ AutopayResp

Add autopay rule This POST endpoint is used to add an autopay rule that will initiate a payout whenever the provided wallet token is loaded.
You can use this endpoint to create an autopay rule that automatically sends a percentage of incoming load to a specific destination.
To use this endpoint, you need to provide the user_token and wallet_token as required parameters in the URL Path, and the destination_token and percentage of incoming load that should be autopaid to the destination_token in the request Body.
The response will include a JSON object containing the details of the created autopay rule, including the token, destination_token and percentage.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Options Hash (opts):

  • :autopay_rule (AutopayRule)

    Autopay rule configuration

Returns:



28
29
30
31
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 28

def create_autopay_rule(user_token, wallet_token, opts = {})
  data, _status_code, _headers = create_autopay_rule_with_http_info(user_token, wallet_token, opts)
  data
end

#create_autopay_rule_with_http_info(user_token, wallet_token, opts = {}) ⇒ Array<(AutopayResp, Integer, Hash)>

Add autopay rule This POST endpoint is used to add an autopay rule that will initiate a payout whenever the provided wallet token is loaded. &lt;br&gt; You can use this endpoint to create an autopay rule that automatically sends a percentage of incoming load to a specific destination. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path, and the &#x60;destination_token&#x60; and percentage of incoming load that should be autopaid to the &#x60;destination_token&#x60; in the request Body. &lt;br&gt; The response will include a JSON object containing the details of the created autopay rule, including the token, &#x60;destination_token&#x60; and percentage.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Options Hash (opts):

  • :autopay_rule (AutopayRule)

    Autopay rule configuration

Returns:

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

    AutopayResp data, response status code and response headers



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

def create_autopay_rule_with_http_info(user_token, wallet_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.create_autopay_rule ...'
  end
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.create_autopay_rule"
  end
  # verify the required parameter 'wallet_token' is set
  if @api_client.config.client_side_validation && wallet_token.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.create_autopay_rule"
  end
  # resource path
  local_var_path = '/wallet/{user_token}/{wallet_token}/autopay'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))

  # 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'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'autopay_rule'])

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

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

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

#delete_autopay_rule(user_token, wallet_token, token, opts = {}) ⇒ nil

Delete autopay rule This DELETE endpoint is used to delete an existing autopay rule.
You can use this endpoint to remove an autopay rule that is no longer needed.
To use this endpoint, you need to provide the user_token and wallet_token as required parameters in the URL Path, and the token of the autopay rule you wish to delete in the request Body.
The response will include a message indicating the success of the deletion.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

  • token (String)

    Autopay token to delete

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

    the optional parameters

Returns:

  • (nil)


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

def delete_autopay_rule(user_token, wallet_token, token, opts = {})
  delete_autopay_rule_with_http_info(user_token, wallet_token, token, opts)
  nil
end

#delete_autopay_rule_with_http_info(user_token, wallet_token, token, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete autopay rule This DELETE endpoint is used to delete an existing autopay rule. &lt;br&gt; You can use this endpoint to remove an autopay rule that is no longer needed. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path, and the token of the autopay rule you wish to delete in the request Body. &lt;br&gt; The response will include a message indicating the success of the deletion.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

  • token (String)

    Autopay token to delete

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 116

def delete_autopay_rule_with_http_info(user_token, wallet_token, token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.delete_autopay_rule ...'
  end
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.delete_autopay_rule"
  end
  # verify the required parameter 'wallet_token' is set
  if @api_client.config.client_side_validation && wallet_token.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.delete_autopay_rule"
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling WalletApi.delete_autopay_rule"
  end
  # resource path
  local_var_path = '/wallet/{user_token}/{wallet_token}/autopay'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))

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

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

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

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

#get_autopay_rules(user_token, wallet_token, opts = {}) ⇒ Array<AutopayResp>

Get all autopay rules This GET endpoint is used to retrieve all autopay rules currently applied to the provided wallet token.
You can use this endpoint to obtain information about the autopay rules associated with the wallet.
To use this endpoint, you need to provide the user_token and wallet_token as required parameters in the URL Path.
The response will include a JSON array containing details for each autopay rule, including the token, destination_token and percentage.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Returns:



179
180
181
182
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 179

def get_autopay_rules(user_token, wallet_token, opts = {})
  data, _status_code, _headers = get_autopay_rules_with_http_info(user_token, wallet_token, opts)
  data
end

#get_autopay_rules_with_http_info(user_token, wallet_token, opts = {}) ⇒ Array<(Array<AutopayResp>, Integer, Hash)>

Get all autopay rules This GET endpoint is used to retrieve all autopay rules currently applied to the provided wallet token. &lt;br&gt; You can use this endpoint to obtain information about the autopay rules associated with the wallet. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path. &lt;br&gt; The response will include a JSON array containing details for each autopay rule, including the token, &#x60;destination_token&#x60; and percentage.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Returns:

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

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



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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 190

def get_autopay_rules_with_http_info(user_token, wallet_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_autopay_rules ...'
  end
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.get_autopay_rules"
  end
  # verify the required parameter 'wallet_token' is set
  if @api_client.config.client_side_validation && wallet_token.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.get_autopay_rules"
  end
  # resource path
  local_var_path = '/wallet/{user_token}/{wallet_token}/autopay'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))

  # 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<AutopayResp>'

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

  new_options = opts.merge(
    :operation => :"WalletApi.get_autopay_rules",
    :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: WalletApi#get_autopay_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallet(user_token, opts = {}) ⇒ Array<WalletTxnResp>

Retrieve all available wallets for a user This GET endpoint is used to retrieve all available wallets for a provided user token.
You can use this endpoint to obtain information about the wallets associated with the provided user token.
To use this endpoint, you need to provide the user_token as a required parameter in the URL Path.
The response will include a JSON array containing details for each wallet including user_token, balance, currency_code.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Unique key to prevent duplicate processing

Returns:



248
249
250
251
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 248

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

#get_wallet_card_info(user_token, wallet_token, opts = {}) ⇒ GetWalletCardInfo200Response

Get MassPay Card Information This GET endpoint is used to retrieve MassPay card information associated with the provided wallet token.
You can use this endpoint to obtain information about the MassPay card associated with the wallet.
To use this endpoint, you need to provide the user_token and wallet_token as required parameters in the URL Path.
The response will include a JSON object containing details for the MassPay card, including the card number, balance, status.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Returns:



314
315
316
317
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 314

def get_wallet_card_info(user_token, wallet_token, opts = {})
  data, _status_code, _headers = get_wallet_card_info_with_http_info(user_token, wallet_token, opts)
  data
end

#get_wallet_card_info_with_http_info(user_token, wallet_token, opts = {}) ⇒ Array<(GetWalletCardInfo200Response, Integer, Hash)>

Get MassPay Card Information This GET endpoint is used to retrieve MassPay card information associated with the provided wallet token. &lt;br&gt; You can use this endpoint to obtain information about the MassPay card associated with the wallet. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as required parameters in the URL Path. &lt;br&gt; The response will include a JSON object containing details for the MassPay card, including the card number, balance, status.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Returns:



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
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 325

def get_wallet_card_info_with_http_info(user_token, wallet_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet_card_info ...'
  end
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.get_wallet_card_info"
  end
  # verify the required parameter 'wallet_token' is set
  if @api_client.config.client_side_validation && wallet_token.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.get_wallet_card_info"
  end
  # resource path
  local_var_path = '/wallet/{user_token}/{wallet_token}/card'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))

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

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

  new_options = opts.merge(
    :operation => :"WalletApi.get_wallet_card_info",
    :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: WalletApi#get_wallet_card_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallet_with_http_info(user_token, opts = {}) ⇒ Array<(Array<WalletTxnResp>, Integer, Hash)>

Retrieve all available wallets for a user This GET endpoint is used to retrieve all available wallets for a provided user token. &lt;br&gt; You can use this endpoint to obtain information about the wallets associated with the provided user token. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; as a required parameter in the URL Path. &lt;br&gt; The response will include a JSON array containing details for each wallet including &#x60;user_token&#x60;, &#x60;balance&#x60;, &#x60;currency_code&#x60;.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Unique key to prevent duplicate processing

Returns:

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

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



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 259

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

  # 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'])
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"WalletApi.get_wallet",
    :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: WalletApi#get_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_wallet_card_info(user_token, wallet_token, opts = {}) ⇒ nil

Update MassPay Card Information This PUT endpoint is used to update the MassPay card information for a provided user token and wallet token.
You can use this endpoint to help your users manage their MassPay card information, including updating their card PIN number or status.
To use this endpoint, you need to provide the user_token and wallet_token as parameters in the URL Path, along with the parameters in the request Query, including the card pin number or(and) status.
The endpoint will then update the card information for the provided user and wallet token.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Options Hash (opts):

  • :pin (String)

    New 4 digit pin number for the card (To be used in ATM machines)

  • :status (String)

    New status for the card

Returns:

  • (nil)


385
386
387
388
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 385

def update_wallet_card_info(user_token, wallet_token, opts = {})
  update_wallet_card_info_with_http_info(user_token, wallet_token, opts)
  nil
end

#update_wallet_card_info_with_http_info(user_token, wallet_token, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update MassPay Card Information This PUT endpoint is used to update the MassPay card information for a provided user token and wallet token. &lt;br&gt; You can use this endpoint to help your users manage their MassPay card information, including updating their card PIN number or status. &lt;br&gt; To use this endpoint, you need to provide the &#x60;user_token&#x60; and &#x60;wallet_token&#x60; as parameters in the URL Path, along with the parameters in the request Query, including the card pin number or(and) status. &lt;br&gt; The endpoint will then update the card information for the provided user and wallet token.

Parameters:

  • user_token (String)

    Token representing the user who owns the wallet

  • wallet_token (String)

    Token representing the wallet

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

    the optional parameters

Options Hash (opts):

  • :pin (String)

    New 4 digit pin number for the card (To be used in ATM machines)

  • :status (String)

    New status for the card

Returns:

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

    nil, response status code and response headers



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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/masspay_ruby_sdk/api/wallet_api.rb', line 398

def update_wallet_card_info_with_http_info(user_token, wallet_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.update_wallet_card_info ...'
  end
  # verify the required parameter 'user_token' is set
  if @api_client.config.client_side_validation && user_token.nil?
    fail ArgumentError, "Missing the required parameter 'user_token' when calling WalletApi.update_wallet_card_info"
  end
  # verify the required parameter 'wallet_token' is set
  if @api_client.config.client_side_validation && wallet_token.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_token' when calling WalletApi.update_wallet_card_info"
  end
  pattern = Regexp.new(/^[0-9]{4}$/)
  if @api_client.config.client_side_validation && !opts[:'pin'].nil? && opts[:'pin'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"pin\"]' when calling WalletApi.update_wallet_card_info, must conform to the pattern #{pattern}."
  end

  allowable_values = ["SUSPEND", "UNSUSPEND", "CLOSE"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/wallet/{user_token}/{wallet_token}/card'.sub('{' + 'user_token' + '}', CGI.escape(user_token.to_s)).sub('{' + 'wallet_token' + '}', CGI.escape(wallet_token.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pin'] = opts[:'pin'] if !opts[:'pin'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

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

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

  new_options = opts.merge(
    :operation => :"WalletApi.update_wallet_card_info",
    :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: WalletApi#update_wallet_card_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end