Sha256: d322b30a5d3059eba4fdb58b59f6e7ae62f86c3ab10dca5f175f1464b2ea9664

Contents?: true

Size: 1.09 KB

Versions: 34

Compression:

Stored size: 1.09 KB

Contents

require 'test_helper'

class RemoteSecurePayTechTest < Test::Unit::TestCase
  $verbose = true

  def setup
    @gateway = SecurePayTechGateway.new(fixtures(:secure_pay_tech))
    
    @accepted_amount = 10000
    @declined_amount = 10075
    
    @credit_card = credit_card('4987654321098769', :month => '5', :year => '2013')
    @options = { :billing_address => address }
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@accepted_amount, @credit_card, @options)
    assert_equal 'Transaction OK', response.message
    assert_success response
  end

  def test_unsuccessful_purchase
    assert response = @gateway.purchase(@declined_amount, @credit_card, @options)
    assert_equal 'Card declined', response.message
    assert_failure response
  end

  def test_invalid_login
    gateway = SecurePayTechGateway.new(
                :login => 'foo',
                :password => 'bar'
              )
    assert response = gateway.purchase(@accepted_amount, @credit_card, @options)
    assert_equal 'Bad or malformed request', response.message
    assert_failure response
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

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