Sha256: c0aaeb3a4f927fdff9bf76fa02d84268c7732e6bf7ca589d8cfb1ab032fd8caf

Contents?: true

Size: 1.12 KB

Versions: 11

Compression:

Stored size: 1.12 KB

Contents

require File.dirname(__FILE__) + '/../../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

11 entries across 11 versions & 5 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/remote/gateways/remote_secure_pay_tech_test.rb
seamusabshere-active_merchant-1.4.2.1 test/remote/gateways/remote_secure_pay_tech_test.rb
seamusabshere-active_merchant-1.4.2.3 test/remote/gateways/remote_secure_pay_tech_test.rb
activemerchant-1.4.1 test/remote/gateways/remote_secure_pay_tech_test.rb
activemerchant-1.3.2 test/remote/gateways/remote_secure_pay_tech_test.rb
activemerchant-1.4.0 test/remote/gateways/remote_secure_pay_tech_test.rb
activemerchant-1.3.0 test/remote/gateways/remote_secure_pay_tech_test.rb
activemerchant-1.3.1 test/remote/gateways/remote_secure_pay_tech_test.rb
activemerchant-1.4.2 test/remote/gateways/remote_secure_pay_tech_test.rb
merb_merchant-1.4.1 test/remote/gateways/remote_secure_pay_tech_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/remote/gateways/remote_secure_pay_tech_test.rb