Sha256: 2093f7391fc9c39292dce5e8d47e51dc2233ab7777f79d44eeb34c8e5f77c979

Contents?: true

Size: 746 Bytes

Versions: 10

Compression:

Stored size: 746 Bytes

Contents

require File.dirname(__FILE__) + '/../../../test_helper'

class HiTrustReturnTest < Test::Unit::TestCase
  include ActiveMerchant::Billing::Integrations

  def test_successful_return
    r = HiTrust::Return.new('order_id=&mscssid=&retcode=00&ordernumber=1138742&type=Auth')
    assert r.success?
    assert_equal HiTrust::Return::SUCCESS, r.params['retcode']
    assert_equal HiTrust::Return::CODES[HiTrust::Return::SUCCESS], r.message
  end
  
  def test_failed_return
    r = HiTrust::Return.new('retcode=-100')
    assert_false r.success?
    assert_equal HiTrust::Return::CODES['-100'], r.message
  end
  
  def test_unknown_return
    r = HiTrust::Return.new('retcode=unknown')
    assert_false r.success?
    assert_nil r.message
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/unit/integrations/returns/hi_trust_return_test.rb
seamusabshere-active_merchant-1.4.2.1 test/unit/integrations/returns/hi_trust_return_test.rb
seamusabshere-active_merchant-1.4.2.3 test/unit/integrations/returns/hi_trust_return_test.rb
activemerchant-1.4.0 test/unit/integrations/returns/hi_trust_return_test.rb
activemerchant-1.3.2 test/unit/integrations/returns/hi_trust_return_test.rb
activemerchant-1.3.1 test/unit/integrations/returns/hi_trust_return_test.rb
activemerchant-1.3.0 test/unit/integrations/returns/hi_trust_return_test.rb
activemerchant-1.4.1 test/unit/integrations/returns/hi_trust_return_test.rb
activemerchant-1.4.2 test/unit/integrations/returns/hi_trust_return_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/unit/integrations/returns/hi_trust_return_test.rb