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

Returns a new instance of Gateway.



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

def initialize(options = {})
  @encoding = options[:encoding]
  @key1     = options[:key1]
  @key2     = options[:key2]
  @pos_id   = options[:pos_id]
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

#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



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

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

#confirm(session_id) ⇒ Object

Confirms transaction



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

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

#get(session_id) ⇒ Object

Gets transaction status



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

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