Class: Paycom::Login
- Inherits:
-
Object
- Object
- Paycom::Login
- Defined in:
- lib/paycom.rb
Constant Summary collapse
- URL =
URI('https://www.paycomonline.net/v4/ee/ee-loginproc.php')
- REFERER =
'https://www.paycomonline.net/v4/ee/ee-login.php'
Instance Method Summary collapse
- #cookies ⇒ Object
-
#initialize(username, password, pin) ⇒ Login
constructor
A new instance of Login.
Constructor Details
#initialize(username, password, pin) ⇒ Login
Returns a new instance of Login.
13 14 15 16 17 18 19 20 |
# File 'lib/paycom.rb', line 13 def initialize(username,password,pin) Paycom.http_start(URL) do |http| request = Net::HTTP::Post.new URL.path request.set_form_data signon_hash(username,password,pin) request['Referer'] = REFERER @response = http.request request end end |
Instance Method Details
#cookies ⇒ Object
22 23 24 |
# File 'lib/paycom.rb', line 22 def @response.to_hash['set-cookie'].reverse.map { |c| $1 if c=~ /(pcm[=0-9a-zA-Z]*)/ }.join '; ' end |