class Transbank::Webpay::Client

Constants

Attributes

http[RW]
uri[RW]

Public Class Methods

new(wsdl_url) click to toggle source
# File lib/transbank/webpay/client.rb, line 8
def initialize(wsdl_url)
  opt = Transbank::Webpay.configuration.http_options
  self.uri = URI.parse wsdl_url
  self.http = Net::HTTP.new uri.host, uri.port

  # load options
  define_options(opt)

  # default options
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end

Public Instance Methods

post(xml) click to toggle source
# File lib/transbank/webpay/client.rb, line 21
def post(xml)
  http.post(uri.path, xml, HEADER)
end

Private Instance Methods

define_options(opt = {}) click to toggle source
# File lib/transbank/webpay/client.rb, line 27
def define_options(opt = {})
  opt.each { |attr, value| http.__send__("#{attr}=", value) }
end