Class: Bambora::Rest::BatchPaymentFileUploadClient

Inherits:
Client
  • Object
show all
Defined in:
lib/bambora/rest/batch_payment_file_upload_client.rb

Constant Summary collapse

CONTENT_DISPOSITION =
'form-data'
CONTENT_TYPES =
{
  text_plain: 'text/plain',
  application_json: 'application/json',
}.freeze
FILE_TYPE_HEADER =
{ 'FileType' => 'STD' }.freeze

Instance Attribute Summary

Attributes inherited from Client

#base_url, #merchant_id, #sub_merchant_id

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Bambora::Rest::Client

Instance Method Details

#post(args = {}) ⇒ Object

Parameters:

  • args (:file_contents) (defaults to: {})
    String

    CSV file contents

  • args (:options) (defaults to: {})
    Hash

    Request Parameters as documented by Bambora.

  • args (:api_key) (defaults to: {})
    String


16
17
18
19
20
21
22
23
24
25
# File 'lib/bambora/rest/batch_payment_file_upload_client.rb', line 16

def post(args = {})
  init_payload(args[:file_contents], args[:options])
  parse_response_body(
    super(
      path: args[:path],
      body: @payload.body,
      headers: build_headers(api_key: args[:api_key]),
    ),
  ).to_h
end