Class: Payu::Transaction
- Inherits:
-
Object
- Object
- Payu::Transaction
- Defined in:
- lib/payu/transaction.rb
Instance Attribute Summary collapse
-
#add_signature ⇒ Object
Returns the value of attribute add_signature.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#amount_netto ⇒ Object
Returns the value of attribute amount_netto.
-
#city ⇒ Object
Returns the value of attribute city.
-
#client_ip ⇒ Object
Returns the value of attribute client_ip.
-
#country ⇒ Object
Returns the value of attribute country.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#desc2 ⇒ Object
Returns the value of attribute desc2.
-
#email ⇒ Object
Returns the value of attribute email.
-
#encoding ⇒ Object
Returns the value of attribute encoding.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gateway_url ⇒ Object
Returns the value of attribute gateway_url.
-
#js ⇒ Object
Returns the value of attribute js.
-
#key1 ⇒ Object
Returns the value of attribute key1.
-
#language ⇒ Object
Returns the value of attribute language.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#pay_type ⇒ Object
Returns the value of attribute pay_type.
-
#payback_login ⇒ Object
Returns the value of attribute payback_login.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#pos_auth_key ⇒ Object
Returns the value of attribute pos_auth_key.
-
#pos_id ⇒ Object
Returns the value of attribute pos_id.
-
#post_code ⇒ Object
Returns the value of attribute post_code.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#sig ⇒ Object
Returns the value of attribute sig.
-
#street ⇒ Object
Returns the value of attribute street.
-
#street_an ⇒ Object
Returns the value of attribute street_an.
-
#street_hn ⇒ Object
Returns the value of attribute street_hn.
-
#trsDesc ⇒ Object
Returns the value of attribute trsDesc.
-
#ts ⇒ Object
Returns the value of attribute ts.
-
#variant ⇒ Object
Returns the value of attribute variant.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #new_url ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Transaction
Returns a new instance of Transaction.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/payu/transaction.rb', line 11 def initialize( = {}) [:session_id] ||= Timestamp.generate .each do |name, value| send("#{name.to_s}=", value) end validate! if [:add_signature] self.ts = Timestamp.generate self.sig = generate_signature end if variant == 'sms' self.amount_netto = amount self.amount = nil end end |
Instance Attribute Details
#add_signature ⇒ Object
Returns the value of attribute add_signature.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def add_signature @add_signature end |
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def amount @amount end |
#amount_netto ⇒ Object
Returns the value of attribute amount_netto.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def amount_netto @amount_netto end |
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def city @city end |
#client_ip ⇒ Object
Returns the value of attribute client_ip.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def client_ip @client_ip end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def country @country end |
#desc ⇒ Object
Returns the value of attribute desc.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def desc @desc end |
#desc2 ⇒ Object
Returns the value of attribute desc2.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def desc2 @desc2 end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def email @email end |
#encoding ⇒ Object
Returns the value of attribute encoding.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def encoding @encoding end |
#first_name ⇒ Object
Returns the value of attribute first_name.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def first_name @first_name end |
#gateway_url ⇒ Object
Returns the value of attribute gateway_url.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def gateway_url @gateway_url end |
#js ⇒ Object
Returns the value of attribute js.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def js @js end |
#key1 ⇒ Object
Returns the value of attribute key1.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def key1 @key1 end |
#language ⇒ Object
Returns the value of attribute language.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def language @language end |
#last_name ⇒ Object
Returns the value of attribute last_name.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def last_name @last_name end |
#order_id ⇒ Object
Returns the value of attribute order_id.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def order_id @order_id end |
#pay_type ⇒ Object
Returns the value of attribute pay_type.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def pay_type @pay_type end |
#payback_login ⇒ Object
Returns the value of attribute payback_login.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def payback_login @payback_login end |
#phone ⇒ Object
Returns the value of attribute phone.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def phone @phone end |
#pos_auth_key ⇒ Object
Returns the value of attribute pos_auth_key.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def pos_auth_key @pos_auth_key end |
#pos_id ⇒ Object
Returns the value of attribute pos_id.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def pos_id @pos_id end |
#post_code ⇒ Object
Returns the value of attribute post_code.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def post_code @post_code end |
#session_id ⇒ Object
Returns the value of attribute session_id.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def session_id @session_id end |
#sig ⇒ Object
Returns the value of attribute sig.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def sig @sig end |
#street ⇒ Object
Returns the value of attribute street.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def street @street end |
#street_an ⇒ Object
Returns the value of attribute street_an.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def street_an @street_an end |
#street_hn ⇒ Object
Returns the value of attribute street_hn.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def street_hn @street_hn end |
#trsDesc ⇒ Object
Returns the value of attribute trsDesc.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def trsDesc @trsDesc end |
#ts ⇒ Object
Returns the value of attribute ts.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def ts @ts end |
#variant ⇒ Object
Returns the value of attribute variant.
5 6 7 |
# File 'lib/payu/transaction.rb', line 5 def variant @variant end |
Instance Method Details
#new_url ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/payu/transaction.rb', line 31 def new_url if variant == 'sms' return "https://#{gateway_url}/paygw/#{encoding}/NewSMS" else return "https://#{gateway_url}/paygw/#{encoding}/NewPayment" end end |