Sha256: 6ef5b8aaf409bda372fcd79e5df59c23998bb9e15af8fd5a5239bc3fbcd5bfaf

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module WebPay
        class Notification < ActiveMerchant::Billing::Integrations::Notification
          include Common

          def self.recognizes?(params)
            params.has_key?('site_order_id') && params.has_key?('amount')
          end

          def complete?
            true
          end

          def amount
            BigDecimal.new(gross)
          end

          def item_id
            params['site_order_id']
          end

          def security_key
            params[ActiveMerchant::Billing::Integrations::WebPay.signature_parameter_name]
          end

          def gross
            params['amount']
          end

          def status
            'success'
          end

          def secret
            @options[:secret]
          end

          def acknowledge(authcode = nil)
            (security_key == generate_signature(:notify))
          end

          def success_response(*args)
            {:nothing => true}
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
activemerchant-1.43.3 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.41.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/web_pay/notification.rb