Class: Payu::Gateway
- Inherits:
-
Object
- Object
- Payu::Gateway
- Defined in:
- lib/payu/gateway.rb
Instance Attribute Summary collapse
-
#encoding ⇒ Object
readonly
Returns the value of attribute encoding.
-
#key1 ⇒ Object
readonly
Returns the value of attribute key1.
-
#key2 ⇒ Object
readonly
Returns the value of attribute key2.
-
#pos_id ⇒ Object
readonly
Returns the value of attribute pos_id.
Instance Method Summary collapse
-
#cancel(session_id) ⇒ Object
Cancels transaction.
-
#confirm(session_id) ⇒ Object
Confirms transaction.
-
#get(session_id) ⇒ Object
Gets transaction status.
-
#initialize(options = {}) ⇒ Gateway
constructor
A new instance of Gateway.
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( = {}) @encoding = [:encoding] @key1 = [:key1] @key2 = [:key2] @pos_id = [:pos_id] end |
Instance Attribute Details
#encoding ⇒ Object (readonly)
Returns the value of attribute encoding.
8 9 10 |
# File 'lib/payu/gateway.rb', line 8 def encoding @encoding end |
#key1 ⇒ Object (readonly)
Returns the value of attribute key1.
8 9 10 |
# File 'lib/payu/gateway.rb', line 8 def key1 @key1 end |
#key2 ⇒ Object (readonly)
Returns the value of attribute key2.
8 9 10 |
# File 'lib/payu/gateway.rb', line 8 def key2 @key2 end |
#pos_id ⇒ Object (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 |