Sha256: b213fd1eb4949e2d9e184fccc587f29ffda793ece2a2691f8ff99c0a295b4e5b

Contents?: true

Size: 1.09 KB

Versions: 34

Compression:

Stored size: 1.09 KB

Contents

require 'net/http'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Dwolla
        class Notification < ActiveMerchant::Billing::Integrations::Notification
          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['Message']
          end

          # Was this a test transaction?
          def test?
            params['TestMode']
          end

          def acknowledge      
            true
          end
 private
          # Take the posted data and move the relevant data into a hash
          def parse(post)
            @raw = post.to_s
            json_post = JSON.parse(post)
            params.merge!(json_post)
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 5 rubygems

Version Path
activemerchant-1.32.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.32.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.31.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.31.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.30.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
jelaniharris-activemerchant-1.29.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.29.3 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.29.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.29.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
jelaniharris-activemerchant-1.29.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.29.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-nsp-1.27.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.28.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
yetanothernguyen-activemerchant-1.21.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.27.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
yetanothernguyen-activemerchant-1.21.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.26.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.25.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
jelaniharris-activemerchant-1.24.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.24.0 lib/active_merchant/billing/integrations/dwolla/notification.rb