Sha256: 2d6126920f2e7b5c63b2847e78632df3b07db7d1e667a19d2bd0c807990416f4

Contents?: true

Size: 1.18 KB

Versions: 18

Compression:

Stored size: 1.18 KB

Contents

require "net/http"

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Maksuturva
        class Notification < ActiveMerchant::Billing::Integrations::Notification
          def complete?
            true
          end

          def transaction_id
            params["pmt_id"]
          end

          def security_key
            params["pmt_hash"]
          end

          def gross
            params["pmt_amount"]
          end

          def currency
            params["pmt_currency"]
          end

          def status
            "PAID"
          end

          def acknowledge(authcode = nil)
            return_authcode = [params["pmt_action"], params["pmt_version"], params["pmt_id"], params["pmt_reference"], params["pmt_amount"], params["pmt_currency"], params["pmt_sellercosts"], params["pmt_paymentmethod"], params["pmt_escrow"], authcode].join("&")
            (Digest::MD5.hexdigest(return_authcode + "&").upcase == params["pmt_hash"])
          end

          private

          def parse(post)
            post.each do |key, value|
              params[key] = value
            end
          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/maksuturva/notification.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.41.0 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/maksuturva/notification.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/maksuturva/notification.rb