Class: Transbank::Oneclick::Client
- Inherits:
-
Object
- Object
- Transbank::Oneclick::Client
- Defined in:
- lib/transbank/oneclick/client.rb
Constant Summary collapse
- HEADER =
{ 'Content-Type' => 'application/soap+xml; charset=utf-8' }
Instance Attribute Summary collapse
-
#http ⇒ Object
Returns the value of attribute http.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(opt = {}) ⇒ Client
constructor
A new instance of Client.
- #post(xml_canonicalize) ⇒ Object
Constructor Details
#initialize(opt = {}) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/transbank/oneclick/client.rb', line 7 def initialize(opt = {}) opt = Transbank::Oneclick.configuration..merge(opt) self.uri = URI.parse Transbank::Oneclick.configuration.url self.http = Net::HTTP.new uri.host, uri.port # load options (opt) # default options http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end |
Instance Attribute Details
#http ⇒ Object
Returns the value of attribute http.
4 5 6 |
# File 'lib/transbank/oneclick/client.rb', line 4 def http @http end |
#uri ⇒ Object
Returns the value of attribute uri.
4 5 6 |
# File 'lib/transbank/oneclick/client.rb', line 4 def uri @uri end |
Instance Method Details
#post(xml_canonicalize) ⇒ Object
20 21 22 |
# File 'lib/transbank/oneclick/client.rb', line 20 def post(xml_canonicalize) http.post(uri.path, xml_canonicalize, HEADER) end |