| Class | ActiveMerchant::Billing::Integrations::Notification |
| In: |
lib/active_merchant/billing/integrations/notification.rb
|
| Parent: | Object |
| params | [RW] | |
| raw | [RW] |
# File lib/active_merchant/billing/integrations/notification.rb, line 11
11: def initialize(post, options = {})
12: @options = options
13: empty!
14: parse(post)
15: end
This combines the gross and currency and returns a proper Money object. this requires the money library located at dist.leetsoft.com/api/money
# File lib/active_merchant/billing/integrations/notification.rb, line 32
32: def amount
33: return Money.new(gross_cents, currency) rescue ArgumentError
34: return Money.new(gross_cents) # maybe you have an own money object which doesn't take a currency?
35: end
reset the notification.
# File lib/active_merchant/billing/integrations/notification.rb, line 38
38: def empty!
39: @params = Hash.new
40: @raw = ""
41: end
# File lib/active_merchant/billing/integrations/notification.rb, line 26
26: def gross_cents
27: (gross.to_f * 100.0).round
28: end
# File lib/active_merchant/billing/integrations/notification.rb, line 17
17: def status
18: raise NotImplementedError, "Must implement this method in the subclass"
19: end