Class: Moneybookers::PaymentGateway::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/moneybookers/payment_gateway/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/moneybookers/payment_gateway/client.rb', line 7

def initialize(params={})
  @parameters = params
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



5
6
7
# File 'lib/moneybookers/payment_gateway/client.rb', line 5

def parameters
  @parameters
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/moneybookers/payment_gateway/client.rb', line 5

def response
  @response
end

Instance Method Details

#prepareObject

TODO: validate required params



12
13
14
# File 'lib/moneybookers/payment_gateway/client.rb', line 12

def prepare
  @response = Moneybookers::Request.new.post("/app/payment.pl", {:prepare_only => 1}.merge(parameters))
end

#session_idObject



16
17
18
# File 'lib/moneybookers/payment_gateway/client.rb', line 16

def session_id
  CGI::Cookie.parse(response["Set-Cookie"])["SESSION_ID"].first
end