Sha256: 0506b5b5122456e3edc734d04fa4ba24bb55e6222a3fb2047bd4213368134f56

Contents?: true

Size: 1.15 KB

Versions: 34

Compression:

Stored size: 1.15 KB

Contents

require 'test_helper'

class RemoteViaklixTest < Test::Unit::TestCase
  def setup
    @gateway = ViaklixGateway.new(fixtures(:viaklix))
    
    @credit_card = credit_card    
    @bad_credit_card = credit_card('invalid')
    
    @options = {
      :order_id => '#1000.1',
      :email => "paul@domain.com",   
      :description => 'Test Transaction',
      :billing_address => address
    }
    @amount = 100
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    
    assert_success response
    assert response.test?
    assert_equal 'APPROVED', response.message
    assert response.authorization
  end
  
  def test_failed_purchase
    assert response = @gateway.purchase(@amount, @bad_credit_card, @options)
  
    assert_failure response
    assert response.test?
    assert_equal 'The Credit Card Number supplied in the authorization request appears invalid.', response.message
  end
  
  def test_credit
    assert purchase = @gateway.purchase(@amount, @credit_card, @options)
    assert_success purchase
    
    assert credit = @gateway.credit(@amount, @credit_card)
    assert_success credit
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

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