Parent

Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::Notification

Attributes

params[RW]
raw[RW]

Public Class Methods

new(post, options = {}) click to toggle source
# File lib/active_merchant/billing/integrations/notification.rb, line 11
def initialize(post, options = {})
  @options = options
  empty!
  parse(post)
end

Public Instance Methods

amount() click to toggle source

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
def amount
  return Money.new(gross_cents, currency) rescue ArgumentError
  return Money.new(gross_cents) # maybe you have an own money object which doesn't take a currency?
end
empty!() click to toggle source

reset the notification.

# File lib/active_merchant/billing/integrations/notification.rb, line 38
def empty!
  @params  = Hash.new
  @raw     = ""      
end
gross() click to toggle source

the money amount we received in X.2 decimal.

# File lib/active_merchant/billing/integrations/notification.rb, line 22
def gross
  raise NotImplementedError, "Must implement this method in the subclass"
end
gross_cents() click to toggle source
# File lib/active_merchant/billing/integrations/notification.rb, line 26
def gross_cents
  (gross.to_f * 100.0).round
end
status() click to toggle source
# File lib/active_merchant/billing/integrations/notification.rb, line 17
def status
  raise NotImplementedError, "Must implement this method in the subclass"
end
valid_sender?(ip) click to toggle source

Check if the request comes from an official IP

# File lib/active_merchant/billing/integrations/notification.rb, line 44
def valid_sender?(ip)
  return true if ActiveMerchant::Billing::Base.integration_mode == :test || production_ips.blank?
  production_ips.include?(ip)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.