Sha256: cc8865e87a395a728f6a588790bfda5d00d2cadaa8a26f6e700ce5ca97c2afa5

Contents?: true

Size: 1.86 KB

Versions: 6

Compression:

Stored size: 1.86 KB

Contents

require 'digest/md5'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Valitor
        module ResponseFields
          def success?
            acknowledge
          end
          alias :complete? :success?
          
          def test?
            @options[:test]
          end
          
          def order
            params['Tilvisunarnumer']
          end
          
          def received_at
            params['Dagsetning']
          end
          
          def transaction_id
            params['VefverslunSalaID']
          end
          
          def status
            "OK"
          end
          
          def card_type
            params['Kortategund']
          end
          
          def card_last_four
            params['KortnumerSidustu']
          end
          
          def authorization_number
            params['Heimildarnumer']
          end
          
          def transaction_number
            params['Faerslunumer']
          end
          
          def customer_name
            params['Nafn']
          end
          
          def customer_address
            params['Heimilisfang']
          end
          
          def customer_zip
            params['Postnumer']
          end
          
          def customer_city
            params['Stadur']
          end
          
          def customer_country
            params['Land']
          end
          
          def customer_email
            params['Tolvupostfang']
          end
          
          def customer_comment
            params['Athugasemdir']
          end
          
          def password
            @options[:credential2]
          end
          
          def acknowledge
            password ? Digest::MD5.hexdigest("#{password}#{order}") == params['RafraenUndirskriftSvar'] : true
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
bitfluent-activemerchant-1.15.1 lib/active_merchant/billing/integrations/valitor/response_fields.rb
activemerchant-kiddy-1.15.0.kiddy.1 lib/active_merchant/billing/integrations/valitor/response_fields.rb
activemerchant-kiddy-1.15.0.kiddy lib/active_merchant/billing/integrations/valitor/response_fields.rb
activemerchant-1.15.0 lib/active_merchant/billing/integrations/valitor/response_fields.rb
activemerchant-1.14.0 lib/active_merchant/billing/integrations/valitor/response_fields.rb
activemerchant-1.13.0 lib/active_merchant/billing/integrations/valitor/response_fields.rb