Permalink
Browse files

remove hard coded configuration and add log

  • Loading branch information...
1 parent 0fcd17e commit 549ab0179e7037a908e0f0044fed9aa5fd96a97c @rafaelss committed May 14, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/cielo/capture_request.rb
@@ -9,11 +9,15 @@ class CaptureRequest
has_one :shop, Shop
def capture
- http = Net::HTTP.new("qasecommerce.cielo.com.br", 443)
+ http = Net::HTTP.new(Cielo.configuration.host, Cielo.configuration.port)
http.use_ssl = true
http.open_timeout = 10 * 1000
http.read_timeout = 40 * 1000
- response = http.request_post("/servicos/ecommwsec.do", "mensagem=#{to_xml}")
+ Cielo.logger.info(http.inspect)
+
+ response = http.request_post(Cielo.configuration.path, "mensagem=#{to_xml}")
+ Cielo.logger.info(response.body)
+
Transaction.parse(response.body, :single => true)
end
end

0 comments on commit 549ab01

Please sign in to comment.