class OffsitePayments::Integrations::EasyPay::Notification

Public Class Methods

new(data, options) click to toggle source
Calls superclass method OffsitePayments::Notification::new
# File lib/offsite_payments/integrations/easy_pay.rb, line 87
def initialize(data, options)
  if options[:credential2].nil?
    raise ArgumentError, "You need to provide the md5 secret as the option :credential2 to verify that the notification originated from EasyPay"
  end

  super
end
recognizes?(params) click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 95
def self.recognizes?(params)
  params.has_key?('order_mer_code') && params.has_key?('sum')
end

Public Instance Methods

acknowledge(authcode = nil) click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 127
def acknowledge(authcode = nil)
  security_key == generate_signature(:notify)
end
amount() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 103
def amount
  BigDecimal.new(gross)
end
complete?() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 99
def complete?
  true
end
gross() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 115
def gross
  params['sum']
end
item_id() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 107
def item_id
  params['order_mer_code']
end
secret() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 123
def secret
  @options[:credential2]
end
security_key() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 111
def security_key
  params[OffsitePayments::Integrations::EasyPay.notify_signature_parameter_name]
end
status() click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 119
def status
  'Completed'
end
success_response(*args) click to toggle source
# File lib/offsite_payments/integrations/easy_pay.rb, line 131
def success_response(*args)
  { :nothing => true }
end