Sha256: aac03c7d712ed8cf8c115ca77719aa63f7bb069d364538c168c42b04c11a4aaf
Contents?: true
Size: 1.33 KB
Versions: 2
Compression:
Stored size: 1.33 KB
Contents
require File.dirname(__FILE__) + '/../../test_helper' class PslCardTest < Test::Unit::TestCase # 100 Cents AMOUNT = 100 def setup @gateway = PslCardGateway.new( :login => 'LOGIN', :password => 'PASSWORD' ) @creditcard = credit_card('4242424242424242') end def test_successful_purchase @creditcard.number = 1 assert response = @gateway.purchase(AMOUNT, @creditcard, {}) assert_success response assert_equal '5555', response.authorization assert response.test? end def test_successful_authorization @creditcard.number = 1 assert response = @gateway.authorize(AMOUNT, @creditcard, {}) assert_success response assert_equal '5555', response.authorization assert response.test? end def test_unsuccessful_request @creditcard.number = 2 assert response = @gateway.purchase(AMOUNT, @creditcard, {}) assert_failure response assert response.test? end def test_request_error @creditcard.number = 3 assert_raise(Error){ @gateway.purchase(AMOUNT, @creditcard, {}) } end def test_supported_countries assert_equal ['GB'], PslCardGateway.supported_countries end def test_supported_card_types assert_equal [ :visa, :master, :american_express, :diners_club, :jcb, :switch, :solo, :maestro ], PslCardGateway.supported_cardtypes end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activemerchant-1.2.0 | test/unit/gateways/psl_card_test.rb |
activemerchant-1.2.1 | test/unit/gateways/psl_card_test.rb |