Class: Biro::Ph3a::Request
Instance Method Summary
collapse
#soap, #wsdl
Methods inherited from BaseRequest
#initialize, #url
Instance Method Details
#development_url ⇒ Object
6
7
8
|
# File 'lib/biro/gateways/ph3a/request.rb', line 6
def development_url
'https://ws.databusca.com.br/DataHistory.svc?wsdl'
end
|
#find(document) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/biro/gateways/ph3a/request.rb', line 18
def find(document)
begin
@retries ||= 0
@token = nil
params = {}
get_parameters params, document
response = soap.call(:get_person_data, message: params)
Response.new(response)
rescue => e
Biro.log(:warn, "Unable to process Ph3a request")
retry if (@retries += 1) < 3 && e.message.include?("User not authenticated")
raise AuthenticationError.new("Error at PH3A request: #{e.message}") if e.message.include?("User not authenticated")
raise StandardError.new("Error at PH3A request: #{e.message}")
end
end
|
#production_url ⇒ Object
10
11
12
|
# File 'lib/biro/gateways/ph3a/request.rb', line 10
def production_url
'https://ws.databusca.com.br/DataHistory.svc?wsdl'
end
|
#required_params ⇒ Object
14
15
16
|
# File 'lib/biro/gateways/ph3a/request.rb', line 14
def required_params
[:username, :password, :domain]
end
|