Sha256: b15e9c9d83426566bf8cd4a96700a8ef00394089e31cc13d746eda54e1004b88

Contents?: true

Size: 1.26 KB

Versions: 18

Compression:

Stored size: 1.26 KB

Contents

require 'net/http'
require 'digest/sha1'

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

          def initialize(data, options)
            super
          end

          def complete?
            (status == "Completed")
          end

          def status
            params["Status"]
          end

          def transaction_id
            params['TransactionId']
          end

          def item_id
            params['OrderId']
          end

          def currency
            "USD"
          end

          def gross
            params['Amount']
          end

          def error
            params['Error']
          end

          def test?
            params['TestMode'] != "false"
          end

          def acknowledge(authcode = nil)
            true
          end
        
        private

          def parse(post)
            @raw = post.to_s
            json_post = JSON.parse(post)
            verify_signature(json_post['CheckoutId'], json_post['Amount'], json_post['Signature'], @options[:credential3])

            params.merge!(json_post)
          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/dwolla/notification.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.41.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/dwolla/notification.rb