Sha256: 135ce1b0cec1b4dc7a2824c7427f19817227e44778f8320d46748272fccf11a9

Contents?: true

Size: 1003 Bytes

Versions: 11

Compression:

Stored size: 1003 Bytes

Contents

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

          def recognizes?
            (params.has_key?('LMI_PAYMENT_NO') && params.has_key?('LMI_PAYMENT_AMOUNT'))
          end

          def amount
            BigDecimal.new(gross)
          end

          def key_present?
            params["LMI_HASH"].present?
          end

          def item_id
            params['LMI_PAYMENT_NO']
          end

          def gross
            params['LMI_PAYMENT_AMOUNT']
          end

          def security_key
            params["LMI_HASH"]
          end

          def secret
            @options[:secret]
          end

          def acknowledge
            (security_key == generate_signature)
          end

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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
tanga_activemerchant-1.38.0.5 lib/active_merchant/billing/integrations/webmoney/notification.rb
tanga_activemerchant-1.38.0.4 lib/active_merchant/billing/integrations/webmoney/notification.rb
tanga_activemerchant-1.38.0.3 lib/active_merchant/billing/integrations/webmoney/notification.rb
tanga_activemerchant-1.38.0.2 lib/active_merchant/billing/integrations/webmoney/notification.rb
tanga_activemerchant-1.38.0.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
tanga_activemerchant-1.38.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
tanga_activemerchant-1.37.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.38.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.38.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.37.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.36.0 lib/active_merchant/billing/integrations/webmoney/notification.rb