Class: ActiveMerchant::Billing::Integrations::Ccavenue::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/active_merchant_ccavenue/notification.rb

Instance Method Summary collapse

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/active_merchant_ccavenue/notification.rb', line 17

def complete?
    'Y' == self.status
end

#grossObject

the money amount we received in X.2 decimal.



34
35
36
# File 'lib/active_merchant_ccavenue/notification.rb', line 34

def gross
    params['Amount']
end

#payment_idObject



21
22
23
# File 'lib/active_merchant_ccavenue/notification.rb', line 21

def payment_id
    params['Order_Id']
end

#security_keyObject



29
30
31
# File 'lib/active_merchant_ccavenue/notification.rb', line 29

def security_key
    params['Checksum']
end

#statusObject



38
39
40
# File 'lib/active_merchant_ccavenue/notification.rb', line 38

def status
    params['AuthDesc']
end

#transaction_idObject



25
26
27
# File 'lib/active_merchant_ccavenue/notification.rb', line 25

def transaction_id
    params['nb_order_no']
end

#valid?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
14
15
# File 'lib/active_merchant_ccavenue/notification.rb', line 6

def valid?
    verify_checksum(
        self.security_key,
        ActiveMerchant::Billing::Integrations::Ccavenue.merchant_id,
        self.payment_id,
        self.gross,
        self.status,
        ActiveMerchant::Billing::Integrations::Ccavenue.work_key
    )
end