Class: OffsitePayments::Integrations::Webmoney::Notification

Inherits:
Notification
  • Object
show all
Includes:
Common
Defined in:
lib/offsite_payments/integrations/webmoney.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, #iso_currency, #status, #test?, #valid_sender?

Constructor Details

This class inherits a constructor from OffsitePayments::Notification

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object


109
110
111
# File 'lib/offsite_payments/integrations/webmoney.rb', line 109

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

#amountObject


85
86
87
# File 'lib/offsite_payments/integrations/webmoney.rb', line 85

def amount
  BigDecimal.new(gross)
end

#grossObject


97
98
99
# File 'lib/offsite_payments/integrations/webmoney.rb', line 97

def gross
  params['LMI_PAYMENT_AMOUNT']
end

#item_idObject


93
94
95
# File 'lib/offsite_payments/integrations/webmoney.rb', line 93

def item_id
  params['LMI_PAYMENT_NO']
end

#key_present?Boolean


89
90
91
# File 'lib/offsite_payments/integrations/webmoney.rb', line 89

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

#recognizes?Boolean


81
82
83
# File 'lib/offsite_payments/integrations/webmoney.rb', line 81

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

#secretObject


105
106
107
# File 'lib/offsite_payments/integrations/webmoney.rb', line 105

def secret
  @options[:secret]
end

#security_keyObject


101
102
103
# File 'lib/offsite_payments/integrations/webmoney.rb', line 101

def security_key
  params["LMI_HASH"]
end

#success_response(*args) ⇒ Object


113
114
115
# File 'lib/offsite_payments/integrations/webmoney.rb', line 113

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