Sha256: 06401d3101d271c570b5c5bde0886217a3f62c275bfbd486531626be10bccce4

Contents?: true

Size: 844 Bytes

Versions: 84

Compression:

Stored size: 844 Bytes

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      class Return
        attr_accessor :params
      
        def initialize(query_string)
          @params = parse(query_string)
        end
      
        # Successful by default. Overridden in the child class
        def success?
          true
        end
      
        def message
          
        end
        
        def parse(query_string)
          return {} if query_string.blank?
          
          query_string.split('&').inject({}) do |memo, chunk|
            next if chunk.empty?
            key, value = chunk.split('=', 2)
            next if key.empty?
            value = value.nil? ? nil : CGI.unescape(value)
            memo[CGI.unescape(key)] = value
            memo
          end
        end 
      end
    end
  end
end

Version data entries

84 entries across 84 versions & 24 rubygems

Version Path
activemerchant-abn-ideal-1.7.0b lib/active_merchant/billing/integrations/return.rb
goldstar-activemerchant-1.4.2.6 lib/active_merchant/billing/integrations/return.rb
johnreitano-activemerchant-1.5.11 lib/active_merchant/billing/integrations/return.rb
tomriley-active_merchant-1.4.2.11 lib/active_merchant/billing/integrations/return.rb
tomriley-active_merchant-1.4.2.10 lib/active_merchant/billing/integrations/return.rb
activemerchant-1.8.0 lib/active_merchant/billing/integrations/return.rb
smulube-activemerchant-1.7.1.5 lib/active_merchant/billing/integrations/return.rb
smulube-activemerchant-1.7.1.4 lib/active_merchant/billing/integrations/return.rb
johnreitano-activemerchant-1.5.10 lib/active_merchant/billing/integrations/return.rb
activemerchant-1.7.3 lib/active_merchant/billing/integrations/return.rb
johnreitano-activemerchant-1.5.9 lib/active_merchant/billing/integrations/return.rb
smulube-activemerchant-1.7.1.3 lib/active_merchant/billing/integrations/return.rb
glebm-activemerchant-1.7.2.1 lib/active_merchant/billing/integrations/return.rb
activemerchant-1.7.2 lib/active_merchant/billing/integrations/return.rb
projectdx_activemerchant-1.7.1.20100817.3 lib/active_merchant/billing/integrations/return.rb
projectdx_activemerchant-1.7.1.20100817.2 lib/active_merchant/billing/integrations/return.rb
projectdx_activemerchant-1.7.1.20100817.1 lib/active_merchant/billing/integrations/return.rb
humanzz-activemerchant-1.7.1.1 lib/active_merchant/billing/integrations/return.rb
humanzz-activemerchant-1.7.1 lib/active_merchant/billing/integrations/return.rb
smulube-activemerchant-1.7.1 lib/active_merchant/billing/integrations/return.rb