Class: Tray::Checkout::WebService

Inherits:
Object
  • Object
show all
Defined in:
lib/tray/checkout/web_service.rb

Instance Method Summary collapse

Instance Method Details

#request!(url, params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tray/checkout/web_service.rb', line 9

def request!(url, params)
  uri = URI.parse(url)
  http = build_http(uri)

  request = build_request(uri, params)
  log_request(request, url)

  response = http.request(request)
  log_response(response)

  http.finish if http.started?

  response.body
end