class Transbank::Oneclick::Client
Constants
- HEADER
Attributes
http[RW]
uri[RW]
Public Class Methods
new(opt = {})
click to toggle source
# File lib/transbank/oneclick/client.rb, line 7 def initialize(opt = {}) opt = Transbank::Oneclick.configuration.http_options.merge(opt) self.uri = URI.parse Transbank::Oneclick.configuration.url self.http = Net::HTTP.new uri.host, uri.port # load options set_options(opt) # default options http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end
Public Instance Methods
post(xml_canonicalize)
click to toggle source
# File lib/transbank/oneclick/client.rb, line 20 def post(xml_canonicalize) http.post(uri.path, xml_canonicalize, HEADER) end
Private Instance Methods
set_options(opt = {})
click to toggle source
# File lib/transbank/oneclick/client.rb, line 25 def set_options(opt = {}) opt.each {|attr, value| http.__send__("#{attr}=", value)} end