Class: ActiveMerchant::Billing::Integrations::Webmoney::Notification

Inherits:
Notification
  • Object
show all
Includes:
Common
Defined in:
lib/active_merchant/billing/integrations/webmoney/notification.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods included from Common

#generate_signature, #generate_signature_string

Methods inherited from Notification

#empty!, #gross_cents, #initialize, #status, #test?, #valid_sender?

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Integrations::Notification

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object



36
37
38
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 36

def acknowledge(authcode = nil)
  (security_key == generate_signature)
end

#amountObject



12
13
14
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 12

def amount
  BigDecimal.new(gross)
end

#grossObject



24
25
26
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 24

def gross
  params['LMI_PAYMENT_AMOUNT']
end

#item_idObject



20
21
22
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 20

def item_id
  params['LMI_PAYMENT_NO']
end

#key_present?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 16

def key_present?
  params["LMI_HASH"].present?
end

#recognizes?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 8

def recognizes?
  (params.has_key?('LMI_PAYMENT_NO') && params.has_key?('LMI_PAYMENT_AMOUNT'))
end

#secretObject



32
33
34
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 32

def secret
  @options[:secret]
end

#security_keyObject



28
29
30
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 28

def security_key
  params["LMI_HASH"]
end

#success_response(*args) ⇒ Object



40
41
42
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 40

def success_response(*args)
  {:nothing => true}
end