Class: PayuPayment

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/payu_payment.rb

Constant Summary collapse

BANK_CODES =
{
  "AXIS Bank NetBanking"                  => "AXIB", 
  "Citibank Netbanking"                   => "CITNB", 
  "Corporation Bank"                      => "CRPB", 
  "Deutsche Bank"                         => "DSHB", 
  "HDFC Bank"                             => "HDFB", 
  "ICICI NetBanking"                      => "ICIB", 
  "Industrial Development Bank of India"  => "IDBB",
  "State Bank of India"                   => "SBIB", 
  "Union Bank of India"                   => "UBIB", 
  "Yes Bank"                              => "YESB"
}
PAYU_TYPE =
{
  "Netbanking"  => "NB",
  "Credit Card" => "CC",
  "Debit Card"  => "DC"
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_from(params) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'app/models/payu_payment.rb', line 26

def self.new_from(params)
  PayuPayment.new(
  :payment_id=> params['mihpayid'],
  :mode => params['mode'],
  :status => params['status'],
  :key => params['key'],
  :transaction_id=> params['txnid'],
  :amount => BigDecimal.new(params['amount']).to_f,
  :discount=> params['discount'],
  :json=> params) 
end

Instance Method Details

#process!(payment) ⇒ Object



38
39
40
# File 'app/models/payu_payment.rb', line 38

def process!(payment)
  payment.complete
end