Class: ApiBanking::SoapClient
- Inherits:
-
Object
- Object
- ApiBanking::SoapClient
show all
- Defined in:
- lib/api_banking/soap/soap_client.rb
Class Method Summary
collapse
Class Method Details
.do_remote_call(env, callbacks = nil, soapAction = nil, &block) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/api_banking/soap/soap_client.rb', line 9
def self.do_remote_call(env, callbacks = nil, soapAction = nil, &block)
data = construct_envelope(&block)
options = {}
options[:method] = :post
options[:body] = data.to_xml
(options, soapAction)
set_options_for_environment(env, options)
options[:headers]['User-Agent'] = "Quantiguous; API Banking, Ruby Gem #{ApiBanking::VERSION}"
request = Typhoeus::Request.new(env.endpoints[self.name.split('::').last.to_sym], options)
callbacks.before_send.call(request) if (callbacks && callbacks.before_send.respond_to?(:call))
response = request.run
callbacks.on_complete.call(request.response) if (callbacks && callbacks.on_complete.respond_to?(:call))
Thread.current[:last_response] = response
parse_response(response)
end
|
.last_response ⇒ Object
5
6
7
|
# File 'lib/api_banking/soap/soap_client.rb', line 5
def self.last_response
Thread.current[:last_response]
end
|