Class: Payu::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/payu/gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Gateway



10
11
12
13
14
15
16
# File 'lib/payu/gateway.rb', line 10

def initialize(options = {})
  @encoding    = options[:encoding]
  @key1        = options[:key1]
  @key2        = options[:key2]
  @pos_id      = options[:pos_id]
  @gateway_url = options[:gateway_url] || 'www.platnosci.pl'
end

Instance Attribute Details

#encodingObject (readonly)

Returns the value of attribute encoding.



8
9
10
# File 'lib/payu/gateway.rb', line 8

def encoding
  @encoding
end

#gateway_urlObject (readonly)

Returns the value of attribute gateway_url.



8
9
10
# File 'lib/payu/gateway.rb', line 8

def gateway_url
  @gateway_url
end

#key1Object (readonly)

Returns the value of attribute key1.



8
9
10
# File 'lib/payu/gateway.rb', line 8

def key1
  @key1
end

#key2Object (readonly)

Returns the value of attribute key2.



8
9
10
# File 'lib/payu/gateway.rb', line 8

def key2
  @key2
end

#pos_idObject (readonly)

Returns the value of attribute pos_id.



8
9
10
# File 'lib/payu/gateway.rb', line 8

def pos_id
  @pos_id
end

Instance Method Details

#cancel(session_id) ⇒ Object

Cancels transaction



29
30
31
# File 'lib/payu/gateway.rb', line 29

def cancel(session_id)
  send_request("/paygw/#{encoding}/Payment/cancel/txt", session_id)
end

#confirm(session_id) ⇒ Object

Confirms transaction



24
25
26
# File 'lib/payu/gateway.rb', line 24

def confirm(session_id)
  send_request("/paygw/#{encoding}/Payment/confirm/txt", session_id)
end

#get(session_id) ⇒ Object

Gets transaction status



19
20
21
# File 'lib/payu/gateway.rb', line 19

def get(session_id)
  send_request("/paygw/#{encoding}/Payment/get/txt", session_id)
end