Sha256: 033218c87bbe96d5d62c43aa3d5394ce097913e9b61a33d2f64ae5734fda408a

Contents?: true

Size: 1.18 KB

Versions: 36

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

class SecurePayTechTest < Test::Unit::TestCase
  def setup
    @gateway = SecurePayTechGateway.new(
                 :login => 'x',
                 :password => 'y'
               )

    @amount = 100
    @credit_card = credit_card('4987654321098769')
    @options = {
      :billing_address => address
    }
  end
  
  def test_successful_purchase
    @gateway.expects(:ssl_post).returns(successful_purchase_response)
  
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_instance_of Response, response
    assert_success response
    assert response.test?
    assert_equal '4--120119220646821', response.authorization
  end
  
  def test_unsuccessful_purchase
    @gateway.expects(:ssl_post).returns(unsuccessful_purchase_response)
  
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_instance_of Response, response
    assert_failure response
    assert response.test?
  end
 
  private
  def successful_purchase_response
    "1,4--120119220646821,000000014511,23284,014511,20080125\r\n"
  end
  
  def unsuccessful_purchase_response
    "4,4--120119180936527,000000014510,23283,014510,20080125\r\n"
  end
end

Version data entries

36 entries across 36 versions & 11 rubygems

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