Sha256: 5a7513889e022c8eb8a57fd0485dc12938417e5b589e66fe9b040fdd953d0e74

Contents?: true

Size: 1.24 KB

Versions: 15

Compression:

Stored size: 1.24 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
            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

15 entries across 15 versions & 2 rubygems

Version Path
tanga_activemerchant-1.38.0.5 lib/active_merchant/billing/integrations/dwolla/notification.rb
tanga_activemerchant-1.38.0.4 lib/active_merchant/billing/integrations/dwolla/notification.rb
tanga_activemerchant-1.38.0.3 lib/active_merchant/billing/integrations/dwolla/notification.rb
tanga_activemerchant-1.38.0.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
tanga_activemerchant-1.38.0.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
tanga_activemerchant-1.38.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
tanga_activemerchant-1.37.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.38.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.38.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.37.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.36.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.35.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.35.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.34.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.34.0 lib/active_merchant/billing/integrations/dwolla/notification.rb