Class: ActiveMerchant::Billing::Integrations::Webmoney::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::Webmoney::Notification
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
#empty!, #gross_cents, #initialize, #status, #test?, #valid_sender?
Instance Method Details
#acknowledge ⇒ Object
36
37
38
|
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 36
def acknowledge
(security_key == generate_signature)
end
|
#amount ⇒ Object
12
13
14
|
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 12
def amount
BigDecimal.new(gross)
end
|
#gross ⇒ Object
24
25
26
|
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 24
def gross
params['LMI_PAYMENT_AMOUNT']
end
|
#item_id ⇒ Object
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
16
17
18
|
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 16
def key_present?
params["LMI_HASH"].present?
end
|
#recognizes? ⇒ 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
|
#secret ⇒ Object
32
33
34
|
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 32
def secret
@options[:secret]
end
|
#security_key ⇒ Object
28
29
30
|
# File 'lib/active_merchant/billing/integrations/webmoney/notification.rb', line 28
def security_key
params["LMI_HASH"]
end
|