Class: ActiveMerchant::Billing::PayuInGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::PayuInGateway
- Defined in:
- app/models/payu_in_gateway.rb
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
- #credit(money, identification, options = {}) ⇒ Object
- #hash(order, payment_method_id) ⇒ Object
-
#initialize(options = {}) ⇒ PayuInGateway
constructor
A new instance of PayuInGateway.
- #merchant_id ⇒ Object
-
#purchase(money, creditcard, options = {}) ⇒ Object
Methods suggested to be supported by active_merchant github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateway.rb.
- #salt ⇒ Object
- #void(identification, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PayuInGateway
Returns a new instance of PayuInGateway.
7 8 9 10 11 |
# File 'app/models/payu_in_gateway.rb', line 7 def initialize( = {}) requires!(, :merchant_id, :salt) @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
41 42 |
# File 'app/models/payu_in_gateway.rb', line 41 def (money, creditcard, = {}) end |
#capture(money, authorization, options = {}) ⇒ Object
44 45 |
# File 'app/models/payu_in_gateway.rb', line 44 def capture(money, , = {}) end |
#credit(money, identification, options = {}) ⇒ Object
50 51 |
# File 'app/models/payu_in_gateway.rb', line 50 def credit(money, identification, = {}) end |
#hash(order, payment_method_id) ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/models/payu_in_gateway.rb', line 21 def hash(order, payment_method_id) if Rails.env.production? || Rails.env.staging? Digest::SHA512.hexdigest("#{self.merchant_id}|#{order.id}|#{order.total.to_f}|#{order.number}|#{order.bill_address.firstname}|#{order.user.email}|#{payment_method_id}||||||||||#{self.salt}") else Digest::SHA512.hexdigest("#{self.merchant_id}|#{order.id}|#{order.total.to_i}|#{order.number}|#{order.bill_address.firstname}|#{order.user.email}|#{payment_method_id}||||||||||#{self.salt}") end end |
#merchant_id ⇒ Object
13 14 15 |
# File 'app/models/payu_in_gateway.rb', line 13 def merchant_id @options[:merchant_id] end |
#purchase(money, creditcard, options = {}) ⇒ Object
Methods suggested to be supported by active_merchant github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateway.rb
purchase(money, creditcard, options = {}) authorize(money, creditcard, options = {}) capture(money, authorization, options = {}) void(identification, options = {}) credit(money, identification, options = {})
38 39 |
# File 'app/models/payu_in_gateway.rb', line 38 def purchase(money, creditcard, = {}) end |
#salt ⇒ Object
17 18 19 |
# File 'app/models/payu_in_gateway.rb', line 17 def salt @options[:salt] end |
#void(identification, options = {}) ⇒ Object
47 48 |
# File 'app/models/payu_in_gateway.rb', line 47 def void(identification, = {}) end |