Class: ActiveMerchant::Billing::Integrations::WebPay::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::WebPay::Notification
show all
- Includes:
- Common
- Defined in:
- lib/active_merchant/billing/integrations/web_pay/notification.rb
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Common
#generate_signature, #notify_signature_string, #request_signature_string
#empty!, #gross_cents, #initialize, #test?, #valid_sender?
Class Method Details
.recognizes?(params) ⇒ Boolean
8
9
10
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 8
def self.recognizes?(params)
params.has_key?('site_order_id') && params.has_key?('amount')
end
|
Instance Method Details
#acknowledge ⇒ Object
40
41
42
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 40
def acknowledge
(security_key == generate_signature(:notify))
end
|
#amount ⇒ Object
16
17
18
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 16
def amount
BigDecimal.new(gross)
end
|
#complete? ⇒ Boolean
12
13
14
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 12
def complete?
true
end
|
#gross ⇒ Object
28
29
30
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 28
def gross
params['amount']
end
|
#item_id ⇒ Object
20
21
22
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 20
def item_id
params['site_order_id']
end
|
#secret ⇒ Object
36
37
38
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 36
def secret
@options[:secret]
end
|
#status ⇒ Object
32
33
34
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 32
def status
'success'
end
|
#success_response(*args) ⇒ Object
44
45
46
|
# File 'lib/active_merchant/billing/integrations/web_pay/notification.rb', line 44
def success_response(*args)
{:nothing => true}
end
|