Class: Adyen::API::SimpleSOAPClient
- Inherits:
-
Object
- Object
- Adyen::API::SimpleSOAPClient
- Defined in:
- lib/adyen/api.rb
Overview
The actual classes
Direct Known Subclasses
Constant Summary collapse
- CACERT =
File.('../../../support/cacert.pem', __FILE__)
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #call_webservice_action(action, data, response_class) ⇒ Object
-
#initialize(params = {}) ⇒ SimpleSOAPClient
constructor
A new instance of SimpleSOAPClient.
Constructor Details
#initialize(params = {}) ⇒ SimpleSOAPClient
Returns a new instance of SimpleSOAPClient.
53 54 55 |
# File 'lib/adyen/api.rb', line 53 def initialize(params = {}) @params = API.default_params.merge(params) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
51 52 53 |
# File 'lib/adyen/api.rb', line 51 def params @params end |
Class Method Details
.endpoint ⇒ Object
47 48 49 |
# File 'lib/adyen/api.rb', line 47 def self.endpoint @endpoint ||= URI.parse(const_get('ENDPOINT_URI') % Adyen.environment) end |
Instance Method Details
#call_webservice_action(action, data, response_class) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/adyen/api.rb', line 57 def call_webservice_action(action, data, response_class) endpoint = self.class.endpoint post = Net::HTTP::Post.new(endpoint.path, 'Accept' => 'text/xml', 'Content-Type' => 'text/xml; charset=utf-8', 'SOAPAction' => action) post.basic_auth(API.username, API.password) post.body = data request = Net::HTTP.new(endpoint.host, endpoint.port) request.use_ssl = true request.ca_file = CACERT request.verify_mode = OpenSSL::SSL::VERIFY_PEER request.start do |http| response_class.new(http.request(post)) end end |