Sha256: ebc13e939f661bbfcacd855df9e1da8ee0c5d121db8b839490e5e96a09cf2933

Contents?: true

Size: 1.69 KB

Versions: 34

Compression:

Stored size: 1.69 KB

Contents

require 'test_helper'

class RemoteModernPaymentsCimTest < Test::Unit::TestCase
  

  def setup
    @gateway = ModernPaymentsCimGateway.new(fixtures(:modern_payments))
    
    @amount = 100
    @credit_card = credit_card('4111111111111111')
    @declined_card = credit_card('4000000000000000')
    
    @options = { 
      :billing_address => address,
      :customer => 'JIMSMITH2000'
    }
  end
  
  def test_successful_create_customer
    response = @gateway.create_customer(@options)
    assert_success response
    assert !response.params["create_customer_result"].blank?
  end
  
  def test_successful_modify_customer_credit_card
    customer = @gateway.create_customer(@options)
    assert_success customer
    
    customer_id = customer.params["create_customer_result"]
    
    credit_card = @gateway.modify_customer_credit_card(customer_id, @credit_card)
    assert_success credit_card
    assert !credit_card.params["modify_customer_credit_card_result"].blank?
  end
  
  def test_succsessful_authorize_credit_card_payment
    customer = @gateway.create_customer(@options)
    assert_success customer
    
    customer_id = customer.params["create_customer_result"]
    
    credit_card = @gateway.modify_customer_credit_card(customer_id, @credit_card)
    assert_success credit_card
    
    payment = @gateway.authorize_credit_card_payment(customer_id, @amount)
    assert_success payment
  end

  def test_invalid_login
    gateway = ModernPaymentsCimGateway.new(
                :login => '',
                :password => ''
              )
    assert response = gateway.create_customer(@options)
    assert_failure response
    assert_equal ModernPaymentsCimGateway::ERROR_MESSAGE, response.message
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

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