Class: Moneybookers::PaymentGateway::Client
- Inherits:
-
Object
- Object
- Moneybookers::PaymentGateway::Client
- Defined in:
- lib/moneybookers/payment_gateway/client.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Client
constructor
A new instance of Client.
-
#prepare ⇒ Object
TODO: validate required params.
- #session_id ⇒ Object
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
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
5 6 7 |
# File 'lib/moneybookers/payment_gateway/client.rb', line 5 def parameters @parameters end |
#response ⇒ Object (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
#prepare ⇒ Object
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_id ⇒ Object
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 |