Sha256: f65d099ffc2d1ea06a1b9b2c346a0ccb55e696ad9a15fa061bea55cc49ad621b

Contents?: true

Size: 711 Bytes

Versions: 34

Compression:

Stored size: 711 Bytes

Contents

require '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

34 entries across 34 versions & 11 rubygems

Version Path
johnideal-activemerchant-1.4.10 test/unit/integrations/returns/hi_trust_return_test.rb
johnideal-activemerchant-1.4.11 test/unit/integrations/returns/hi_trust_return_test.rb
johnideal-activemerchant-1.4.4 test/unit/integrations/returns/hi_trust_return_test.rb
johnideal-activemerchant-1.4.5 test/unit/integrations/returns/hi_trust_return_test.rb
johnideal-activemerchant-1.4.6 test/unit/integrations/returns/hi_trust_return_test.rb
johnideal-activemerchant-1.4.7 test/unit/integrations/returns/hi_trust_return_test.rb
johnideal-activemerchant-1.4.8 test/unit/integrations/returns/hi_trust_return_test.rb
mattbauer-activemerchant-1.4.2 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.3 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.4 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.5 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.6 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.7 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.8 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-tomriley-active_merchant-1.4.2.4 test/unit/integrations/returns/hi_trust_return_test.rb
goldstar-activemerchant-1.4.2.7 test/unit/integrations/returns/hi_trust_return_test.rb
goldstar-activemerchant-1.4.2.6 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.11 test/unit/integrations/returns/hi_trust_return_test.rb
tomriley-active_merchant-1.4.2.10 test/unit/integrations/returns/hi_trust_return_test.rb
smulube-activemerchant-1.5.1.4 test/unit/integrations/returns/hi_trust_return_test.rb