Sha256: dcc3c0ea8c20653ef9a3fc5a3faae20206a243c960c388c03948d1d3bc51d866

Contents?: true

Size: 1.08 KB

Versions: 34

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

class RemotePaySecureTest < Test::Unit::TestCase

  def setup
    @gateway = PaySecureGateway.new(fixtures(:pay_secure))
    
    @credit_card = credit_card('4000100011112224')
    @options = { 
      :billing_address => address,
      :order_id => generate_unique_id
    }
    @amount = 100
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_success response
    assert_equal PaySecureGateway::SUCCESS_MESSAGE, response.message
    assert response.test?
  end

  def test_unsuccessful_purchase
    @credit_card.year = '2006'
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_equal 'Declined, card expired', response.message
    assert_failure response
  end
  
  def test_invalid_login
    gateway = PaySecureGateway.new(
                :login => '',
                :password => ''
              )
    assert response = gateway.purchase(@amount, @credit_card, @options)
    assert_equal "MissingField: 'MERCHANT_ID'", 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_pay_secure_test.rb
johnideal-activemerchant-1.4.11 test/remote/gateways/remote_pay_secure_test.rb
johnideal-activemerchant-1.4.4 test/remote/gateways/remote_pay_secure_test.rb
johnideal-activemerchant-1.4.5 test/remote/gateways/remote_pay_secure_test.rb
johnideal-activemerchant-1.4.6 test/remote/gateways/remote_pay_secure_test.rb
johnideal-activemerchant-1.4.7 test/remote/gateways/remote_pay_secure_test.rb
johnideal-activemerchant-1.4.8 test/remote/gateways/remote_pay_secure_test.rb
mattbauer-activemerchant-1.4.2 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.3 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.4 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.5 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.6 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.7 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.8 test/remote/gateways/remote_pay_secure_test.rb
tomriley-tomriley-active_merchant-1.4.2.4 test/remote/gateways/remote_pay_secure_test.rb
goldstar-activemerchant-1.4.2.7 test/remote/gateways/remote_pay_secure_test.rb
goldstar-activemerchant-1.4.2.6 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.11 test/remote/gateways/remote_pay_secure_test.rb
tomriley-active_merchant-1.4.2.10 test/remote/gateways/remote_pay_secure_test.rb
smulube-activemerchant-1.5.1.4 test/remote/gateways/remote_pay_secure_test.rb