Class: UnifiedPayment::Transaction
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- UnifiedPayment::Transaction
- Includes:
- Utility
- Defined in:
- app/models/unified_payment/transaction.rb
Class Method Summary collapse
- .create_order_at_unified(amount, options) ⇒ Object
- .extract_url_for_unified_payment(response) ⇒ Object
Methods included from Utility
Class Method Details
.create_order_at_unified(amount, options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/models/unified_payment/transaction.rb', line 6 def self.create_order_at_unified(amount, ) 3.times do |attempt| begin @response = Client.create_order((amount.to_f)*100, ) create(:url => @response['url'], :gateway_order_id => @response['orderId'], :gateway_session_id => @response['sessionId'], :xml_response => @response['xml_response'].to_s) break rescue @response = false end end @response end |
.extract_url_for_unified_payment(response) ⇒ Object
19 20 21 |
# File 'app/models/unified_payment/transaction.rb', line 19 def self.extract_url_for_unified_payment(response) response['url'] + '?' + 'ORDERID=' + response['orderId'] + '&' + 'SESSIONID=' + response['sessionId'] end |