Class: Bambora::Rest::XMLClient

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

Overview

The base class for making XML requests.

Constant Summary collapse

CONTENT_TYPE =
'application/xml'
RESPONSE_FORMAT =
'JSON'

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(path:, body:) ⇒ Hash

Make a POST Request.

Parameters:

  • path (String)

    Indicating request path.

  • body (Hash)

    Data to be sent in the body of the request.

  • api_key (String)

    Indicating the API Key to be used with the request.

Returns:

  • (Hash)

    Indicating success or failure of the operation.



18
19
20
21
22
23
24
25
26
# File 'lib/bambora/rest/xml_client.rb', line 18

def post(path:, body:)
  parse_response_body(
    super(
      path: path,
      body: Bambora::Builders::XMLRequestBody.new(body: body).to_s,
      headers: build_headers,
    ),
  )
end