Sha256: da17afefc1f5a0deb604a0e6a938df45d567bb95f9d7e6b9313cabc7f40131e9

Contents?: true

Size: 919 Bytes

Versions: 16

Compression:

Stored size: 919 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
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
activemerchant-1.35.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.35.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.34.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.34.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.33.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.32.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.32.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.31.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.31.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.30.0 lib/active_merchant/billing/integrations/webmoney/notification.rb
jelaniharris-activemerchant-1.29.2 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.29.3 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.29.2 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.29.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
jelaniharris-activemerchant-1.29.1 lib/active_merchant/billing/integrations/webmoney/notification.rb
activemerchant-1.29.0 lib/active_merchant/billing/integrations/webmoney/notification.rb