lib/active_merchant/billing/integrations/easy_pay/notification.rb in activemerchant-1.27.0 vs lib/active_merchant/billing/integrations/easy_pay/notification.rb in activemerchant-1.28.0

- old
+ new

@@ -3,10 +3,18 @@ module Integrations #:nodoc: module EasyPay class Notification < ActiveMerchant::Billing::Integrations::Notification include Common + 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 + def self.recognizes?(params) params.has_key?('order_mer_code') && params.has_key?('sum') end def complete? @@ -28,14 +36,14 @@ def gross params['sum'] end def status - 'success' + 'Completed' end def secret - @options[:secret] + @options[:credential2] end def acknowledge security_key == generate_signature(:notify) end