Sha256: cdc57f5c7747d9b537295b642b3c60f482884c74fbdfc884eb81c8f4ceaa3e0a

Contents?: true

Size: 1.64 KB

Versions: 7

Compression:

Stored size: 1.64 KB

Contents

require 'test_helper'

class RemotePaymentechOrbitalTest < Test::Unit::TestCase
  

  def setup
    @gateway = PaymentechOrbitalGateway.new(fixtures(:paymentech_orbital))
    
    @amount = 100
    @credit_card = credit_card('4000100011112224')
    @declined_card = credit_card('4000300011112220')
    
    @options = { 
      :order_id => '1',
      :billing_address => address,
      :description => 'Store Purchase'
    }
  end
  
  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_success response
    assert_equal 'REPLACE WITH SUCCESS MESSAGE', response.message
  end

  def test_unsuccessful_purchase
    assert response = @gateway.purchase(@amount, @declined_card, @options)
    assert_failure response
    assert_equal 'REPLACE WITH FAILED PURCHASE MESSAGE', response.message
  end

  def test_authorize_and_capture
    amount = @amount
    assert auth = @gateway.authorize(amount, @credit_card, @options)
    assert_success auth
    assert_equal 'Success', auth.message
    assert auth.authorization
    assert capture = @gateway.capture(amount, auth.authorization)
    assert_success capture
  end

  def test_failed_capture
    assert response = @gateway.capture(@amount, '')
    assert_failure response
    assert_equal 'REPLACE WITH GATEWAY FAILURE MESSAGE', response.message
  end

  def test_invalid_login
    gateway = PaymentechOrbitalGateway.new(
                :login => '',
                :password => ''
              )
    assert response = gateway.purchase(@amount, @credit_card, @options)
    assert_failure response
    assert_equal 'REPLACE WITH FAILURE MESSAGE', response.message
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
johnideal-activemerchant-1.4.10 test/remote/gateways/remote_paymentech_orbital_test.rb
johnideal-activemerchant-1.4.11 test/remote/gateways/remote_paymentech_orbital_test.rb
johnideal-activemerchant-1.4.4 test/remote/gateways/remote_paymentech_orbital_test.rb
johnideal-activemerchant-1.4.5 test/remote/gateways/remote_paymentech_orbital_test.rb
johnideal-activemerchant-1.4.6 test/remote/gateways/remote_paymentech_orbital_test.rb
johnideal-activemerchant-1.4.7 test/remote/gateways/remote_paymentech_orbital_test.rb
johnideal-activemerchant-1.4.8 test/remote/gateways/remote_paymentech_orbital_test.rb