Class: Calculator::Ups::Base

Inherits:
ActiveShipping
  • Object
show all
Defined in:
app/models/calculator/ups/base.rb

Instance Method Summary collapse

Instance Method Details

#carrierObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/models/calculator/ups/base.rb', line 2

def carrier
  if Spree::ActiveShipping::Config[:shipper_number].nil?
    ActiveMerchant::Shipping::UPS.new(:login => Spree::ActiveShipping::Config[:ups_login],
                                      :password => Spree::ActiveShipping::Config[:ups_password],
                                      :key => Spree::ActiveShipping::Config[:ups_key])
  else
    ActiveMerchant::Shipping::UPS.new(:login => Spree::ActiveShipping::Config[:ups_login],
                                      :password => Spree::ActiveShipping::Config[:ups_password],
                                      :key => Spree::ActiveShipping::Config[:ups_key],
                                      :origin_account => Spree::ActiveShipping::Config[:shipper_number])
  end

end