Sha256: 4f2118603e328e76ff366ebb93cb0d664aebbb15284471ea8d13412b253fb691

Contents?: true

Size: 1.43 KB

Versions: 34

Compression:

Stored size: 1.43 KB

Contents

require 'test_helper'

class PaypalExpressTest < Test::Unit::TestCase
  def setup
    Base.gateway_mode = :test
    
    @gateway = PaypalExpressGateway.new(fixtures(:paypal_certificate))
  
    @options = {
      :order_id => '230000',
      :email => 'buyer@jadedpallet.com',
      :billing_address => { :name => 'Fred Brooks',
                    :address1 => '1234 Penny Lane',
                    :city => 'Jonsetown',
                    :state => 'NC',
                    :country => 'US',
                    :zip => '23456'
                  } ,
      :description => 'Stuff that you purchased, yo!',
      :ip => '10.0.0.1',
      :return_url => 'http://example.com/return',
      :cancel_return_url => 'http://example.com/cancel'
    }
  end
  
  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_paypal_express_test.rb
johnideal-activemerchant-1.4.11 test/remote/gateways/remote_paypal_express_test.rb
johnideal-activemerchant-1.4.4 test/remote/gateways/remote_paypal_express_test.rb
johnideal-activemerchant-1.4.5 test/remote/gateways/remote_paypal_express_test.rb
johnideal-activemerchant-1.4.6 test/remote/gateways/remote_paypal_express_test.rb
johnideal-activemerchant-1.4.7 test/remote/gateways/remote_paypal_express_test.rb
johnideal-activemerchant-1.4.8 test/remote/gateways/remote_paypal_express_test.rb
mattbauer-activemerchant-1.4.2 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.3 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.4 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.5 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.6 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.7 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.8 test/remote/gateways/remote_paypal_express_test.rb
tomriley-tomriley-active_merchant-1.4.2.4 test/remote/gateways/remote_paypal_express_test.rb
goldstar-activemerchant-1.4.2.7 test/remote/gateways/remote_paypal_express_test.rb
goldstar-activemerchant-1.4.2.6 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.11 test/remote/gateways/remote_paypal_express_test.rb
tomriley-active_merchant-1.4.2.10 test/remote/gateways/remote_paypal_express_test.rb
smulube-activemerchant-1.5.1.4 test/remote/gateways/remote_paypal_express_test.rb