Class: BillForward::ReceiptsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bf_ruby2/api/receipts_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReceiptsApi

Returns a new instance of ReceiptsApi.



30
31
32
# File 'lib/bf_ruby2/api/receipts_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/bf_ruby2/api/receipts_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#create_receipt(receipt, opts = {}) ⇒ ReceiptPagedMetadata

Create a receipt. a new receipt","request":"createReceiptRequest.html","response":"createReceiptResponse.html"

Parameters:

  • receipt

    The receipt object to be created.

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

    the optional parameters

Returns:



39
40
41
42
# File 'lib/bf_ruby2/api/receipts_api.rb', line 39

def create_receipt(receipt, opts = {})
  data, _status_code, _headers = create_receipt_with_http_info(receipt, opts)
  return data
end

#create_receipt_with_http_info(receipt, opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Create a receipt. a new receipt&quot;,&quot;request&quot;:&quot;createReceiptRequest.html&quot;,&quot;response&quot;:&quot;createReceiptResponse.html&quot;

Parameters:

  • receipt

    The receipt object to be created.

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

    the optional parameters

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



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
# File 'lib/bf_ruby2/api/receipts_api.rb', line 49

def create_receipt_with_http_info(receipt, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.create_receipt ..."
  end
  # verify the required parameter 'receipt' is set
  fail ArgumentError, "Missing the required parameter 'receipt' when calling ReceiptsApi.create_receipt" if receipt.nil?
  # resource path
  local_var_path = "/receipts".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/xml', 'application/xml', 'application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(receipt)
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#create_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_receipts(opts = {}) ⇒ ReceiptPagedMetadata

Returns a collection of all receipts. By default 10 values are returned. receipts are returned in natural order all receipts","response":"getreceiptsAll.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first receipt to return. (default to 0)

  • :records (Integer)

    The maximum number of receipts to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :account_id (Array<String>)
  • :invoice_id (Array<String>)
  • :payment_method_id (Array<String>)
  • :type (String)
  • :gateway (String)
  • :decision (String)

Returns:



106
107
108
109
# File 'lib/bf_ruby2/api/receipts_api.rb', line 106

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

#get_all_receipts_with_http_info(opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Returns a collection of all receipts. By default 10 values are returned. receipts are returned in natural order all receipts&quot;,&quot;response&quot;:&quot;getreceiptsAll.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first receipt to return.

  • :records (Integer)

    The maximum number of receipts to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :account_id (Array<String>)
  • :invoice_id (Array<String>)
  • :payment_method_id (Array<String>)
  • :type (String)
  • :gateway (String)
  • :decision (String)

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/bf_ruby2/api/receipts_api.rb', line 126

def get_all_receipts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.get_all_receipts ..."
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if opts[:'type'] && !['credit', 'debit'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of credit, debit'
  end
  if opts[:'gateway'] && !['cybersource_token', 'card_vault', 'paypal_simple', 'locustworld', 'free', 'coupon', 'credit_note', 'stripe', 'braintree', 'balanced', 'paypal', 'billforward_test', 'offline', 'trial', 'stripeACH', 'authorizeNet', 'spreedly', 'sagePay', 'trustCommerce', 'payvision', 'kash'].include?(opts[:'gateway'])
    fail ArgumentError, 'invalid value for "gateway", must be one of cybersource_token, card_vault, paypal_simple, locustworld, free, coupon, credit_note, stripe, braintree, balanced, paypal, billforward_test, offline, trial, stripeACH, authorizeNet, spreedly, sagePay, trustCommerce, payvision, kash'
  end
  if opts[:'decision'] && !['Accept', 'Reject', 'Error'].include?(opts[:'decision'])
    fail ArgumentError, 'invalid value for "decision", must be one of Accept, Reject, Error'
  end
  # resource path
  local_var_path = "/receipts".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'account_id'] = @api_client.build_collection_param(opts[:'account_id'], :multi) if !opts[:'account_id'].nil?
  query_params[:'invoice_id'] = @api_client.build_collection_param(opts[:'invoice_id'], :multi) if !opts[:'invoice_id'].nil?
  query_params[:'payment_method_id'] = @api_client.build_collection_param(opts[:'payment_method_id'], :multi) if !opts[:'payment_method_id'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'gateway'] = opts[:'gateway'] if !opts[:'gateway'].nil?
  query_params[:'decision'] = opts[:'decision'] if !opts[:'decision'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#get_all_receipts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_receipt_by_id(receipt_id, opts = {}) ⇒ ReceiptPagedMetadata

Returns a single receipt, specified by the ID parameter. an existing receipt","response":"getreceiptByID.html"

Parameters:

  • receipt_id

    ID of the receipt.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



195
196
197
198
# File 'lib/bf_ruby2/api/receipts_api.rb', line 195

def get_receipt_by_id(receipt_id, opts = {})
  data, _status_code, _headers = get_receipt_by_id_with_http_info(receipt_id, opts)
  return data
end

#get_receipt_by_id_with_http_info(receipt_id, opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Returns a single receipt, specified by the ID parameter. an existing receipt&quot;,&quot;response&quot;:&quot;getreceiptByID.html&quot;

Parameters:

  • receipt_id

    ID of the receipt.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



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
241
242
243
244
245
246
247
# File 'lib/bf_ruby2/api/receipts_api.rb', line 206

def get_receipt_by_id_with_http_info(receipt_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.get_receipt_by_id ..."
  end
  # verify the required parameter 'receipt_id' is set
  fail ArgumentError, "Missing the required parameter 'receipt_id' when calling ReceiptsApi.get_receipt_by_id" if receipt_id.nil?
  # resource path
  local_var_path = "/receipts/{receipt-ID}".sub('{format}','json').sub('{' + 'receipt-ID' + '}', receipt_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#get_receipt_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_receipts_by_invoice(invoice_id, opts = {}) ⇒ ReceiptPagedMetadata

Returns a receipt for the receipt payment. by invoice","response":"getreceiptsByInvoice.html"

Parameters:

  • invoice_id

    ID of the Invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first receipt to return. (default to 0)

  • :records (Integer)

    The maximum number of receipts to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

Returns:



259
260
261
262
# File 'lib/bf_ruby2/api/receipts_api.rb', line 259

def get_receipts_by_invoice(invoice_id, opts = {})
  data, _status_code, _headers = get_receipts_by_invoice_with_http_info(invoice_id, opts)
  return data
end

#get_receipts_by_invoice_with_http_info(invoice_id, opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Returns a receipt for the receipt payment. by invoice&quot;,&quot;response&quot;:&quot;getreceiptsByInvoice.html&quot;

Parameters:

  • invoice_id

    ID of the Invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first receipt to return.

  • :records (Integer)

    The maximum number of receipts to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/bf_ruby2/api/receipts_api.rb', line 274

def get_receipts_by_invoice_with_http_info(invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.get_receipts_by_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling ReceiptsApi.get_receipts_by_invoice" if invoice_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/receipts/invoice/{invoice-ID}".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#get_receipts_by_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_receipts_by_payment(payment_id, opts = {}) ⇒ ReceiptPagedMetadata

Returns a collection of receipts for the payment. by payment","response":"getreceiptsByPayment.html"

Parameters:

  • payment_id

    ID of the payment.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first receipt to return. (default to 0)

  • :records (Integer)

    The maximum number of receipts to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

Returns:



334
335
336
337
# File 'lib/bf_ruby2/api/receipts_api.rb', line 334

def get_receipts_by_payment(payment_id, opts = {})
  data, _status_code, _headers = get_receipts_by_payment_with_http_info(payment_id, opts)
  return data
end

#get_receipts_by_payment_with_http_info(payment_id, opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Returns a collection of receipts for the payment. by payment&quot;,&quot;response&quot;:&quot;getreceiptsByPayment.html&quot;

Parameters:

  • payment_id

    ID of the payment.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first receipt to return.

  • :records (Integer)

    The maximum number of receipts to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



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
394
395
396
397
# File 'lib/bf_ruby2/api/receipts_api.rb', line 349

def get_receipts_by_payment_with_http_info(payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.get_receipts_by_payment ..."
  end
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling ReceiptsApi.get_receipts_by_payment" if payment_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/receipts/payment/{payment-ID}".sub('{format}','json').sub('{' + 'payment-ID' + '}', payment_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#get_receipts_by_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_receipts_for_debit_payments_as_csv(opts = {}) ⇒ ReceiptPagedMetadata

Retrieves debit payments in CSV format. { "nickname":"Debit payments CSV","response":"Debit payments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :received_start (String)

    The UTC DateTime specifying the start of the interval within which payments were received.

  • :received_end (String)

    The UTC DateTime specifying the end of the interval within which payments were received.

  • :offset (Integer)

    The offset from the first payment to return.

  • :records (Integer)

    The maximum number of payments to return.

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to DESC)

  • :gateway (Array<String>)

    A list of payment gateways to include in the account. If none are specified, all gateways will be included.

Returns:



411
412
413
414
# File 'lib/bf_ruby2/api/receipts_api.rb', line 411

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

#get_receipts_for_debit_payments_as_csv_with_http_info(opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Retrieves debit payments in CSV format. { &quot;nickname&quot;:&quot;Debit payments CSV&quot;,&quot;response&quot;:&quot;Debit payments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :received_start (String)

    The UTC DateTime specifying the start of the interval within which payments were received.

  • :received_end (String)

    The UTC DateTime specifying the end of the interval within which payments were received.

  • :offset (Integer)

    The offset from the first payment to return.

  • :records (Integer)

    The maximum number of payments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

  • :gateway (Array<String>)

    A list of payment gateways to include in the account. If none are specified, all gateways will be included.

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/bf_ruby2/api/receipts_api.rb', line 428

def get_receipts_for_debit_payments_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.get_receipts_for_debit_payments_as_csv ..."
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if opts[:'gateway'] && !['cybersource_token', 'card_vault', 'paypal_simple', 'locustworld', 'free', 'coupon', 'credit_note', 'stripe', 'braintree', 'balanced', 'paypal', 'billforward_test', 'offline', 'trial', 'stripeACH', 'authorizeNet', 'spreedly', 'sagePay', 'trustCommerce', 'payvision', 'kash'].include?(opts[:'gateway'])
    fail ArgumentError, 'invalid value for "gateway", must be one of cybersource_token, card_vault, paypal_simple, locustworld, free, coupon, credit_note, stripe, braintree, balanced, paypal, billforward_test, offline, trial, stripeACH, authorizeNet, spreedly, sagePay, trustCommerce, payvision, kash'
  end
  # resource path
  local_var_path = "/receipts/debits.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'received_start'] = opts[:'received_start'] if !opts[:'received_start'].nil?
  query_params[:'received_end'] = opts[:'received_end'] if !opts[:'received_end'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'gateway'] = @api_client.build_collection_param(opts[:'gateway'], :multi) if !opts[:'gateway'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#get_receipts_for_debit_payments_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_receipts_for_refund_payments_as_csv(opts = {}) ⇒ ReceiptPagedMetadata

Retrieves refunded payments in CSV format. { "nickname":"Refunded payments CSV","response":"Refunded payments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :completed_start (String)

    The UTC DateTime specifying the start of the interval within which payments were received.

  • :completed_end (String)

    The UTC DateTime specifying the end of the interval within which payments were received.

  • :offset (Integer)

    The offset from the first payment to return.

  • :records (Integer)

    The maximum number of payments to return.

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to DESC)

Returns:



493
494
495
496
# File 'lib/bf_ruby2/api/receipts_api.rb', line 493

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

#get_receipts_for_refund_payments_as_csv_with_http_info(opts = {}) ⇒ Array<(ReceiptPagedMetadata, Fixnum, Hash)>

Retrieves refunded payments in CSV format. { &quot;nickname&quot;:&quot;Refunded payments CSV&quot;,&quot;response&quot;:&quot;Refunded payments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :completed_start (String)

    The UTC DateTime specifying the start of the interval within which payments were received.

  • :completed_end (String)

    The UTC DateTime specifying the end of the interval within which payments were received.

  • :offset (Integer)

    The offset from the first payment to return.

  • :records (Integer)

    The maximum number of payments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:

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

    ReceiptPagedMetadata data, response status code and response headers



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/bf_ruby2/api/receipts_api.rb', line 509

def get_receipts_for_refund_payments_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReceiptsApi.get_receipts_for_refund_payments_as_csv ..."
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/receipts/refunds.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'completed_start'] = opts[:'completed_start'] if !opts[:'completed_start'].nil?
  query_params[:'completed_end'] = opts[:'completed_end'] if !opts[:'completed_end'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReceiptPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiptsApi#get_receipts_for_refund_payments_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end