Class: SubskribeDevClient::PaymentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_dev/api/payments_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PaymentsApi

Returns a new instance of PaymentsApi.



19
20
21
# File 'lib/subskribe_dev/api/payments_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/subskribe_dev/api/payments_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_account_payment(id, opts = {}) ⇒ Array<PaymentJson>

Get payments Returns the payments for the specified account

Parameters:

  • id

    id of the account

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/subskribe_dev/api/payments_api.rb', line 27

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

Get account payment management link Returns a payment management link for an account

Parameters:

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

    the optional parameters

Returns:

  • (String)


79
80
81
82
# File 'lib/subskribe_dev/api/payments_api.rb', line 79

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

Get account payment management link Returns a payment management link for an account

Parameters:

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



89
90
91
92
93
94
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
# File 'lib/subskribe_dev/api/payments_api.rb', line 89

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_account_payment_management_link ...'
  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 PaymentsApi.get_account_payment_management_link"
  end
  # resource path
  local_var_path = '/payments/account-payment/{id}'.sub('{' + 'id' + '}', 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 = ['ApiKeyAuth']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#get_account_payment_management_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_payment_with_http_info(id, opts = {}) ⇒ Array<(Array<PaymentJson>, Fixnum, Hash)>

Get payments Returns the payments for the specified account

Parameters:

  • id

    id of the account

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

    the optional parameters

Returns:

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

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



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
# File 'lib/subskribe_dev/api/payments_api.rb', line 37

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_account_payment ...'
  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 PaymentsApi.get_account_payment"
  end
  # resource path
  local_var_path = '/payments/account/{id}'.sub('{' + 'id' + '}', 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 = ['ApiKeyAuth']
  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 => 'Array<PaymentJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#get_account_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payment(id, opts = {}) ⇒ PaymentJson

Get payment details Gets the details of the specified payment

Parameters:

  • id

    id of the payment

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

    the optional parameters

Returns:



131
132
133
134
# File 'lib/subskribe_dev/api/payments_api.rb', line 131

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

#get_payment_balance(id, opts = {}) ⇒ PaymentBalanceJson

Get payment balance Gets the balance of a payment

Parameters:

  • id

    id of the payment

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

    the optional parameters

Returns:



183
184
185
186
# File 'lib/subskribe_dev/api/payments_api.rb', line 183

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

#get_payment_balance_with_http_info(id, opts = {}) ⇒ Array<(PaymentBalanceJson, Fixnum, Hash)>

Get payment balance Gets the balance of a payment

Parameters:

  • id

    id of the payment

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

    the optional parameters

Returns:

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

    PaymentBalanceJson data, response status code and response headers



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
# File 'lib/subskribe_dev/api/payments_api.rb', line 193

def get_payment_balance_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment_balance ...'
  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 PaymentsApi.get_payment_balance"
  end
  # resource path
  local_var_path = '/payments/{id}/balance'.sub('{' + 'id' + '}', 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 = ['ApiKeyAuth']
  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 => 'PaymentBalanceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#get_payment_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payment_configuration(opts = {}) ⇒ PaymentConfiguration

Get payment configuration Returns the payment configuration for your tenant

Parameters:

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

    the optional parameters

Returns:



234
235
236
237
# File 'lib/subskribe_dev/api/payments_api.rb', line 234

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

#get_payment_configuration_with_http_info(opts = {}) ⇒ Array<(PaymentConfiguration, Fixnum, Hash)>

Get payment configuration Returns the payment configuration for your tenant

Parameters:

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

    the optional parameters

Returns:

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

    PaymentConfiguration data, response status code and response headers



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
# File 'lib/subskribe_dev/api/payments_api.rb', line 243

def get_payment_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment_configuration ...'
  end
  # resource path
  local_var_path = '/payments/configuration'

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

#get_payment_with_http_info(id, opts = {}) ⇒ Array<(PaymentJson, Fixnum, Hash)>

Get payment details Gets the details of the specified payment

Parameters:

  • id

    id of the payment

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

    the optional parameters

Returns:

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

    PaymentJson data, response status code and response headers



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
172
173
174
175
176
177
# File 'lib/subskribe_dev/api/payments_api.rb', line 141

def get_payment_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment ...'
  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 PaymentsApi.get_payment"
  end
  # resource path
  local_var_path = '/payments/{id}'.sub('{' + 'id' + '}', 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 = ['ApiKeyAuth']
  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 => 'PaymentJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payments(opts = {}) ⇒ PaymentJsonPaginationResponse

Get all payments Returns all payments for you tenant. The results are paginated. To fetch all take the cursor returned from a call and pass it to a subsequent call.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor returned from previous call

  • :limit (Integer)

    number of results per page

Returns:



282
283
284
285
# File 'lib/subskribe_dev/api/payments_api.rb', line 282

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

#get_payments_with_http_info(opts = {}) ⇒ Array<(PaymentJsonPaginationResponse, Fixnum, Hash)>

Get all payments Returns all payments for you tenant. The results are paginated. To fetch all take the cursor returned from a call and pass it to a subsequent call.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor returned from previous call

  • :limit (Integer)

    number of results per page

Returns:



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
326
327
# File 'lib/subskribe_dev/api/payments_api.rb', line 293

def get_payments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payments ...'
  end
  # resource path
  local_var_path = '/payments'

  # query parameters
  query_params = {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 = ['ApiKeyAuth']
  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 => 'PaymentJsonPaginationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#get_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_payment_configuration(opts = {}) ⇒ PaymentConfiguration

Update payment configuration Updates the payment configuration for your tenant.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (Array<String>)

    Payment types to set. Options can be one or more of the allowable values

Returns:



333
334
335
336
# File 'lib/subskribe_dev/api/payments_api.rb', line 333

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

#update_payment_configuration_with_http_info(opts = {}) ⇒ Array<(PaymentConfiguration, Fixnum, Hash)>

Update payment configuration Updates the payment configuration for your tenant.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (Array<String>)

    Payment types to set. Options can be one or more of the allowable values

Returns:

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

    PaymentConfiguration data, response status code and response headers



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/subskribe_dev/api/payments_api.rb', line 343

def update_payment_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.update_payment_configuration ...'
  end
  # resource path
  local_var_path = '/payments/configuration'

  # 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 = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['ApiKeyAuth']
  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 => 'PaymentConfiguration')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#update_payment_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#void_payment(id, opts = {}) ⇒ PaymentJson

Voids a payment Voids the specified payment per the specified parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



382
383
384
385
# File 'lib/subskribe_dev/api/payments_api.rb', line 382

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

#void_payment_with_http_info(id, opts = {}) ⇒ Array<(PaymentJson, Fixnum, Hash)>

Voids a payment Voids the specified payment per the specified parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    PaymentJson data, response status code and response headers



393
394
395
396
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
# File 'lib/subskribe_dev/api/payments_api.rb', line 393

def void_payment_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.void_payment ...'
  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 PaymentsApi.void_payment"
  end
  # resource path
  local_var_path = '/payments/{id}/void'.sub('{' + 'id' + '}', 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 = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['ApiKeyAuth']
  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 => 'PaymentJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#void_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end