Sha256: b51052af74ccdeeefb281c75ea45d2e24f3bc4ad8f37859c42c4ee92547dc980

Contents?: true

Size: 1.06 KB

Versions: 30

Compression:

Stored size: 1.06 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
            (security_key == generate_signature(:notify))
          end

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

Version data entries

30 entries across 30 versions & 4 rubygems

Version Path
tanga_activemerchant-1.38.0.5 lib/active_merchant/billing/integrations/web_pay/notification.rb
tanga_activemerchant-1.38.0.4 lib/active_merchant/billing/integrations/web_pay/notification.rb
tanga_activemerchant-1.38.0.3 lib/active_merchant/billing/integrations/web_pay/notification.rb
tanga_activemerchant-1.38.0.2 lib/active_merchant/billing/integrations/web_pay/notification.rb
tanga_activemerchant-1.38.0.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
tanga_activemerchant-1.38.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
tanga_activemerchant-1.37.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.38.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.38.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.37.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.36.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.35.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.35.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.34.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.34.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.33.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.32.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.32.0 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.31.1 lib/active_merchant/billing/integrations/web_pay/notification.rb
activemerchant-1.31.0 lib/active_merchant/billing/integrations/web_pay/notification.rb