Class: WorldpayCnp::ApiClient
- Inherits:
-
Object
- Object
- WorldpayCnp::ApiClient
- Defined in:
- lib/worldpay_cnp/api_client.rb
Constant Summary collapse
- HEADERS =
{ 'Content-Type' => 'text/xml; charset=UTF-8', 'User-Agent' => "WorldpayCnpRubyGem/#{WorldpayCnp::VERSION}", 'X-Ruby-Version' => RUBY_VERSION, 'X-Ruby-Platform' => RUBY_PLATFORM }
- INVALID_RESPONSE_VALUES =
%w(1 2 3 4 5)
Instance Method Summary collapse
-
#initialize(config) ⇒ ApiClient
constructor
A new instance of ApiClient.
- #perform_post(url, data) ⇒ Object
Constructor Details
#initialize(config) ⇒ ApiClient
Returns a new instance of ApiClient.
16 17 18 |
# File 'lib/worldpay_cnp/api_client.rb', line 16 def initialize(config) @config = config end |
Instance Method Details
#perform_post(url, data) ⇒ Object
20 21 22 23 |
# File 'lib/worldpay_cnp/api_client.rb', line 20 def perform_post(url, data) response = http_client.post(url, body: XML.serialize(data.to_camel_case)) process_response(response) end |