Class: Paycom::Login

Inherits:
Object
  • Object
show all
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

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

#cookiesObject


22
23
24
# File 'lib/paycom.rb', line 22

def cookies
  @response.to_hash['set-cookie'].reverse.map { |c| $1 if c=~ /(pcm[=0-9a-zA-Z]*)/ }.join '; '
end