Sha256: c21b45ec5f11c7705397447fc9a879f9f506b4e5b613f074e7d7f800b71c8ed0

Contents?: true

Size: 1.47 KB

Versions: 11

Compression:

Stored size: 1.47 KB

Contents

require File.dirname(__FILE__) + '/../../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

11 entries across 11 versions & 5 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/remote/gateways/remote_paypal_express_test.rb
seamusabshere-active_merchant-1.4.2.1 test/remote/gateways/remote_paypal_express_test.rb
seamusabshere-active_merchant-1.4.2.3 test/remote/gateways/remote_paypal_express_test.rb
activemerchant-1.3.0 test/remote/gateways/remote_paypal_express_test.rb
activemerchant-1.3.1 test/remote/gateways/remote_paypal_express_test.rb
activemerchant-1.4.1 test/remote/gateways/remote_paypal_express_test.rb
activemerchant-1.3.2 test/remote/gateways/remote_paypal_express_test.rb
activemerchant-1.4.0 test/remote/gateways/remote_paypal_express_test.rb
activemerchant-1.4.2 test/remote/gateways/remote_paypal_express_test.rb
merb_merchant-1.4.1 test/remote/gateways/remote_paypal_express_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/remote/gateways/remote_paypal_express_test.rb