Module: BankApi::Clients::BancoSecurity::Session
- Included in:
- CompanyClient
- Defined in:
- lib/bank_api/clients/banco_security/concerns/session.rb
Constant Summary collapse
- SESSION_VALIDATION =
"https://www.bancosecurity.cl/empresas/SessionValidation.asp"
Instance Method Summary collapse
Instance Method Details
#cookies ⇒ Object
28 29 30 31 32 |
# File 'lib/bank_api/clients/banco_security/concerns/session.rb', line 28 def selenium_browser.manage..map do || "#{[:name]}=#{[:value]}" end.join("; ") end |
#session_headers ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/bank_api/clients/banco_security/concerns/session.rb', line 19 def session_headers { "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 " + "(KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36", "Accept" => "*/*", "Cookie" => } end |
#setup_authentication ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/bank_api/clients/banco_security/concerns/session.rb', line 7 def setup_authentication response = RestClient::Request.execute( url: SESSION_VALIDATION, method: :post, headers: session_headers ) = response.headers[:set_cookie].first.delete(" ").split(";").map do |a| a.split("=") end .each do |key, value| selenium_browser.manage.(name: key, value: value) end end |