Sha256: 57a00cfe09e76f52bbdd03742c6e073456503fe9ac54b442fb930ec7cdde5217

Contents?: true

Size: 1017 Bytes

Versions: 4

Compression:

Stored size: 1017 Bytes

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['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)
            json_post = JSON.parse(post)
            params.merge!(json_post)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
vibedeck-activemerchant-1.18.2 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.18.1 lib/active_merchant/billing/integrations/dwolla/notification.rb
fishman-activemerchant-1.18.0 lib/active_merchant/billing/integrations/dwolla/notification.rb
activemerchant-1.18.0 lib/active_merchant/billing/integrations/dwolla/notification.rb