Sha256: 3aa18413d106ab2be8e6f3c62d0e6bc9879a9713777561440c0839d7a9abb17d

Contents?: true

Size: 1.71 KB

Versions: 34

Compression:

Stored size: 1.71 KB

Contents

require 'test_helper'

class RemotePayflowTest < Test::Unit::TestCase
  def setup
    Base.gateway_mode = :test
    
    @gateway = PayflowExpressGateway.new(fixtures(:payflow))

    @options = { :billing_address => { 
                                :name => 'Cody Fauser',
                                :address1 => '1234 Shady Brook Lane',
                                :city => 'Ottawa',
                                :state => 'ON',
                                :country => 'CA',
                                :zip => '90210',
                                :phone => '555-555-5555'
                             },
                 :email => 'cody@example.com'
               }
  end
  
  # Only works with a Payflow 2.0 account or by requesting the addition
  # of Express checkout to an existing Payflow Pro account.  This can be done
  # by contacting Payflow sales. The PayPal account used must be a business
  # account and the Payflow Pro account must be in Live mode in order for
  # the tests to work correctly
  def test_set_express_authorization
    @options.update(
      :return_url => 'http://example.com',
      :cancel_return_url => 'http://example.com',
      :email => 'Buyer1@paypal.com'
    )
    response = @gateway.setup_authorization(500, @options)
    assert response.success?
    assert response.test?
    assert !response.params['token'].blank?
  end
  
  def test_set_express_purchase
    @options.update(
      :return_url => 'http://example.com',
      :cancel_return_url => 'http://example.com',
      :email => 'Buyer1@paypal.com'
    )
    response = @gateway.setup_purchase(500, @options)
    assert response.success?
    assert response.test?
    assert !response.params['token'].blank?
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

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